TdClSubChargeInformationMapper.xml 14.6 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.TdClSubChargeInformationMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClSubChargeInformation">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="card_rule_name" jdbcType="VARCHAR" property="cardRuleName" />
    <result column="card_type" jdbcType="INTEGER" property="cardType" />
    <result column="card_status" jdbcType="INTEGER" property="cardStatus" />
    <result column="effect_time" jdbcType="TIMESTAMP" property="effectTime" />
    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
    <result column="unit_price" jdbcType="BIGINT" property="unitPrice" />
    <result column="discount" jdbcType="INTEGER" property="discount" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
    <result column="charge_type" jdbcType="BIGINT" property="chargeType" />
    <result column="charge" jdbcType="BIGINT" property="charge" />
    <result column="count" jdbcType="INTEGER" property="count" />
    <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
    <result column="card_no" jdbcType="VARCHAR" property="cardNo" />
  </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, card_rule_name, card_type, card_status, effect_time, expire_time, unit_price, 
    discount, data_status, create_date, update_date, charge_type, charge, count, customer_no,
    card_no
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TdClSubChargeInformationExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_sub_charge_information
    <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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from td_cl_sub_charge_information
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from td_cl_sub_charge_information
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TdClSubChargeInformationExample">
    delete from td_cl_sub_charge_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TdClSubChargeInformation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_sub_charge_information (card_rule_name, card_type, card_status, 
      effect_time, expire_time, unit_price, 
      discount, data_status, create_date, 
      update_date, charge_type, charge,
      count, customer_no, card_no
      )
    values (#{cardRuleName,jdbcType=VARCHAR}, #{cardType,jdbcType=INTEGER}, #{cardStatus,jdbcType=INTEGER}, 
      #{effectTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{unitPrice,jdbcType=BIGINT}, 
      #{discount,jdbcType=INTEGER}, #{dataStatus,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
      #{updateDate,jdbcType=TIMESTAMP}, #{chargeType,jdbcType=BIGINT}, #{charge,jdbcType=BIGINT},
      #{count,jdbcType=INTEGER}, #{customerNo,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TdClSubChargeInformation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_sub_charge_information
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardRuleName != null">
        card_rule_name,
      </if>
      <if test="cardType != null">
        card_type,
      </if>
      <if test="cardStatus != null">
        card_status,
      </if>
      <if test="effectTime != null">
        effect_time,
      </if>
      <if test="expireTime != null">
        expire_time,
      </if>
      <if test="unitPrice != null">
        unit_price,
      </if>
      <if test="discount != null">
        discount,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="updateDate != null">
        update_date,
      </if>
      <if test="chargeType != null">
        charge_type,
      </if>
      <if test="charge != null">
        charge,
      </if>
      <if test="count != null">
        count,
      </if>
      <if test="customerNo != null">
        customer_no,
      </if>
      <if test="cardNo != null">
        card_no,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardRuleName != null">
        #{cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        #{cardType,jdbcType=INTEGER},
      </if>
      <if test="cardStatus != null">
        #{cardStatus,jdbcType=INTEGER},
      </if>
      <if test="effectTime != null">
        #{effectTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="unitPrice != null">
        #{unitPrice,jdbcType=BIGINT},
      </if>
      <if test="discount != null">
        #{discount,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="chargeType != null">
        #{chargeType,jdbcType=INTEGER},
      </if>
      <if test="charge != null">
        #{charge,jdbcType=BIGINT},
      </if>
      <if test="count != null">
        #{count,jdbcType=INTEGER},
      </if>
      <if test="customerNo != null">
        #{customerNo,jdbcType=VARCHAR},
      </if>
      <if test="cardNo != null">
        #{cardNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TdClSubChargeInformationExample" resultType="java.lang.Long">
    select count(*) from td_cl_sub_charge_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_sub_charge_information
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.cardRuleName != null">
        card_rule_name = #{record.cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="record.cardType != null">
        card_type = #{record.cardType,jdbcType=INTEGER},
      </if>
      <if test="record.cardStatus != null">
        card_status = #{record.cardStatus,jdbcType=INTEGER},
      </if>
      <if test="record.effectTime != null">
        effect_time = #{record.effectTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.expireTime != null">
        expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.unitPrice != null">
        unit_price = #{record.unitPrice,jdbcType=BIGINT},
      </if>
      <if test="record.discount != null">
        discount = #{record.discount,jdbcType=INTEGER},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateDate != null">
        update_date = #{record.updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.chargetype != null">
        chargeType = #{record.chargetype,jdbcType=BIGINT},
      </if>
      <if test="record.charge != null">
        charge = #{record.charge,jdbcType=BIGINT},
      </if>
      <if test="record.count != null">
        count = #{record.count,jdbcType=INTEGER},
      </if>
      <if test="record.customerNo != null">
        customer_no = #{record.customerNo,jdbcType=VARCHAR},
      </if>
      <if test="record.cardNo != null">
        card_no = #{record.cardNo,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_sub_charge_information
    set id = #{record.id,jdbcType=INTEGER},
      card_rule_name = #{record.cardRuleName,jdbcType=VARCHAR},
      card_type = #{record.cardType,jdbcType=INTEGER},
      card_status = #{record.cardStatus,jdbcType=INTEGER},
      effect_time = #{record.effectTime,jdbcType=TIMESTAMP},
      expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
      unit_price = #{record.unitPrice,jdbcType=BIGINT},
      discount = #{record.discount,jdbcType=INTEGER},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      update_date = #{record.updateDate,jdbcType=TIMESTAMP},
      chargeType = #{record.chargetype,jdbcType=BIGINT},
      charge = #{record.charge,jdbcType=BIGINT},
      count = #{record.count,jdbcType=INTEGER},
      customer_no = #{record.customerNo,jdbcType=VARCHAR},
      card_no = #{record.cardNo,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TdClSubChargeInformation">
    update td_cl_sub_charge_information
    <set>
      <if test="cardRuleName != null">
        card_rule_name = #{cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        card_type = #{cardType,jdbcType=INTEGER},
      </if>
      <if test="cardStatus != null">
        card_status = #{cardStatus,jdbcType=INTEGER},
      </if>
      <if test="effectTime != null">
        effect_time = #{effectTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        expire_time = #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="unitPrice != null">
        unit_price = #{unitPrice,jdbcType=BIGINT},
      </if>
      <if test="discount != null">
        discount = #{discount,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        update_date = #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="chargetype != null">
        chargeType = #{chargetype,jdbcType=BIGINT},
      </if>
      <if test="charge != null">
        charge = #{charge,jdbcType=BIGINT},
      </if>
      <if test="count != null">
        count = #{count,jdbcType=INTEGER},
      </if>
      <if test="customerNo != null">
        customer_no = #{customerNo,jdbcType=VARCHAR},
      </if>
      <if test="cardNo != null">
        card_no = #{cardNo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TdClSubChargeInformation">
    update td_cl_sub_charge_information
    set card_rule_name = #{cardRuleName,jdbcType=VARCHAR},
      card_type = #{cardType,jdbcType=INTEGER},
      card_status = #{cardStatus,jdbcType=INTEGER},
      effect_time = #{effectTime,jdbcType=TIMESTAMP},
      expire_time = #{expireTime,jdbcType=TIMESTAMP},
      unit_price = #{unitPrice,jdbcType=BIGINT},
      discount = #{discount,jdbcType=INTEGER},
      data_status = #{dataStatus,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      update_date = #{updateDate,jdbcType=TIMESTAMP},
      chargeType = #{chargetype,jdbcType=BIGINT},
      charge = #{charge,jdbcType=BIGINT},
      count = #{count,jdbcType=INTEGER},
      customer_no = #{customerNo,jdbcType=VARCHAR},
      card_no = #{cardNo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>