TBlackListParkRelMapper.xml 7.1 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zteits.bill.mapper.TBlackListParkRelMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBlackListParkRel">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="rule_no" jdbcType="VARCHAR" property="ruleNo" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, rule_no, pl_no, pl_name
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TBlackListParkRelExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_black_list_park_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_black_list_park_rel
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_black_list_park_rel
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TBlackListParkRelExample">
    delete from t_black_list_park_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TBlackListParkRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_black_list_park_rel (rule_no, pl_no, pl_name
      )
    values (#{ruleNo,jdbcType=VARCHAR}, #{plNo,jdbcType=VARCHAR}, #{plName,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TBlackListParkRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_black_list_park_rel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ruleNo != null">
        rule_no,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ruleNo != null">
        #{ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TBlackListParkRelExample" resultType="java.lang.Long">
    select count(*) from t_black_list_park_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_black_list_park_rel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.ruleNo != null">
        rule_no = #{record.ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_black_list_park_rel
    set id = #{record.id,jdbcType=BIGINT},
      rule_no = #{record.ruleNo,jdbcType=VARCHAR},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      pl_name = #{record.plName,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TBlackListParkRel">
    update t_black_list_park_rel
    <set>
      <if test="ruleNo != null">
        rule_no = #{ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TBlackListParkRel">
    update t_black_list_park_rel
    set rule_no = #{ruleNo,jdbcType=VARCHAR},
      pl_no = #{plNo,jdbcType=VARCHAR},
      pl_name = #{plName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>

</mapper>