TdClParkRuleCollectRelMapper.xml 11.9 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.TdClParkRuleCollectRelMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClParkRuleCollectRel">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="city_id" jdbcType="BIGINT" property="cityId" />
    <result column="eff_date" jdbcType="TIMESTAMP" property="effDate" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="area_id" jdbcType="BIGINT" property="areaId" />
    <result column="rule_collect_id" jdbcType="VARCHAR" property="ruleCollectId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="pro_id" jdbcType="BIGINT" property="proId" />
    <result column="country_id" jdbcType="BIGINT" property="countryId" />
    <result column="city_name" jdbcType="VARCHAR" property="cityName" />
    <result column="country_name" jdbcType="VARCHAR" property="countryName" />
    <result column="pro_name" jdbcType="VARCHAR" property="proName" />
  </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, city_id, eff_date, pl_no, area_id, rule_collect_id, create_time, pro_id, country_id, 
    city_name, country_name, pro_name
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRelExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_park_rule_collect_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 td_cl_park_rule_collect_rel
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_park_rule_collect_rel
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRelExample">
    delete from td_cl_park_rule_collect_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_park_rule_collect_rel (city_id, eff_date, pl_no, 
      area_id, rule_collect_id, create_time, 
      pro_id, country_id, city_name, 
      country_name, pro_name)
    values (#{cityId,jdbcType=BIGINT}, #{effDate,jdbcType=TIMESTAMP}, #{plNo,jdbcType=VARCHAR}, 
      #{areaId,jdbcType=BIGINT}, #{ruleCollectId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{proId,jdbcType=BIGINT}, #{countryId,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR}, 
      #{countryName,jdbcType=VARCHAR}, #{proName,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_park_rule_collect_rel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cityId != null">
        city_id,
      </if>
      <if test="effDate != null">
        eff_date,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="areaId != null">
        area_id,
      </if>
      <if test="ruleCollectId != null">
        rule_collect_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="proId != null">
        pro_id,
      </if>
      <if test="countryId != null">
        country_id,
      </if>
      <if test="cityName != null">
        city_name,
      </if>
      <if test="countryName != null">
        country_name,
      </if>
      <if test="proName != null">
        pro_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cityId != null">
        #{cityId,jdbcType=BIGINT},
      </if>
      <if test="effDate != null">
        #{effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        #{areaId,jdbcType=BIGINT},
      </if>
      <if test="ruleCollectId != null">
        #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="proId != null">
        #{proId,jdbcType=BIGINT},
      </if>
      <if test="countryId != null">
        #{countryId,jdbcType=BIGINT},
      </if>
      <if test="cityName != null">
        #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="countryName != null">
        #{countryName,jdbcType=VARCHAR},
      </if>
      <if test="proName != null">
        #{proName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRelExample" resultType="java.lang.Long">
    select count(*) from td_cl_park_rule_collect_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_park_rule_collect_rel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.cityId != null">
        city_id = #{record.cityId,jdbcType=BIGINT},
      </if>
      <if test="record.effDate != null">
        eff_date = #{record.effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.areaId != null">
        area_id = #{record.areaId,jdbcType=BIGINT},
      </if>
      <if test="record.ruleCollectId != null">
        rule_collect_id = #{record.ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.proId != null">
        pro_id = #{record.proId,jdbcType=BIGINT},
      </if>
      <if test="record.countryId != null">
        country_id = #{record.countryId,jdbcType=BIGINT},
      </if>
      <if test="record.cityName != null">
        city_name = #{record.cityName,jdbcType=VARCHAR},
      </if>
      <if test="record.countryName != null">
        country_name = #{record.countryName,jdbcType=VARCHAR},
      </if>
      <if test="record.proName != null">
        pro_name = #{record.proName,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_cl_park_rule_collect_rel
    set id = #{record.id,jdbcType=BIGINT},
      city_id = #{record.cityId,jdbcType=BIGINT},
      eff_date = #{record.effDate,jdbcType=TIMESTAMP},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      area_id = #{record.areaId,jdbcType=BIGINT},
      rule_collect_id = #{record.ruleCollectId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      pro_id = #{record.proId,jdbcType=BIGINT},
      country_id = #{record.countryId,jdbcType=BIGINT},
      city_name = #{record.cityName,jdbcType=VARCHAR},
      country_name = #{record.countryName,jdbcType=VARCHAR},
      pro_name = #{record.proName,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRel">
    update td_cl_park_rule_collect_rel
    <set>
      <if test="cityId != null">
        city_id = #{cityId,jdbcType=BIGINT},
      </if>
      <if test="effDate != null">
        eff_date = #{effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        area_id = #{areaId,jdbcType=BIGINT},
      </if>
      <if test="ruleCollectId != null">
        rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="proId != null">
        pro_id = #{proId,jdbcType=BIGINT},
      </if>
      <if test="countryId != null">
        country_id = #{countryId,jdbcType=BIGINT},
      </if>
      <if test="cityName != null">
        city_name = #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="countryName != null">
        country_name = #{countryName,jdbcType=VARCHAR},
      </if>
      <if test="proName != null">
        pro_name = #{proName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TdClParkRuleCollectRel">
    update td_cl_park_rule_collect_rel
    set city_id = #{cityId,jdbcType=BIGINT},
      eff_date = #{effDate,jdbcType=TIMESTAMP},
      pl_no = #{plNo,jdbcType=VARCHAR},
      area_id = #{areaId,jdbcType=BIGINT},
      rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      pro_id = #{proId,jdbcType=BIGINT},
      country_id = #{countryId,jdbcType=BIGINT},
      city_name = #{cityName,jdbcType=VARCHAR},
      country_name = #{countryName,jdbcType=VARCHAR},
      pro_name = #{proName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>