TActivityCouponRuleMapper.xml 10.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.TActivityCouponRuleMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TActivityCouponRule">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="card_no" jdbcType="VARCHAR" property="cardNo" />
    <result column="card_name" jdbcType="VARCHAR" property="cardName" />
    <result column="card_res" jdbcType="INTEGER" property="cardRes" />
    <result column="coupons_type" jdbcType="INTEGER" property="couponsType" />
    <result column="use_rule" jdbcType="INTEGER" property="useRule" />
    <result column="disc_value" jdbcType="VARCHAR" property="discValue" />
    <result column="use_range" jdbcType="INTEGER" property="useRange" />
    <result column="is_superp_use" jdbcType="INTEGER" property="isSuperpUse" />
    <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="card_state" jdbcType="INTEGER" property="cardState" />
    <result column="card_remarks" jdbcType="VARCHAR" property="cardRemarks" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modify_empid" jdbcType="VARCHAR" property="modifyEmpid" />
    <result column="modify_name" jdbcType="VARCHAR" property="modifyName" />
    <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, card_no, card_name, card_res, coupons_type, use_rule, disc_value, use_range, 
    is_superp_use, begin_time, end_time, card_state, card_remarks, data_state, create_empid, 
    create_name, create_date, modify_empid, modify_name, modify_date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_activity_coupon_rule
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_activity_coupon_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TActivityCouponRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_coupon_rule (card_no, card_name, card_res, 
      coupons_type, use_rule, disc_value, 
      use_range, is_superp_use, begin_time, 
      end_time, card_state, card_remarks, 
      data_state, create_empid, create_name, 
      create_date, modify_empid, modify_name, 
      modify_date)
    values (#{cardNo,jdbcType=VARCHAR}, #{cardName,jdbcType=VARCHAR}, #{cardRes,jdbcType=INTEGER}, 
      #{couponsType,jdbcType=INTEGER}, #{useRule,jdbcType=INTEGER}, #{discValue,jdbcType=VARCHAR}, 
      #{useRange,jdbcType=INTEGER}, #{isSuperpUse,jdbcType=INTEGER}, #{beginTime,jdbcType=TIMESTAMP}, 
      #{endTime,jdbcType=TIMESTAMP}, #{cardState,jdbcType=INTEGER}, #{cardRemarks,jdbcType=VARCHAR}, 
      #{dataState,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, #{createName,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modifyEmpid,jdbcType=VARCHAR}, #{modifyName,jdbcType=VARCHAR}, 
      #{modifyDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TActivityCouponRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_coupon_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardNo != null">
        card_no,
      </if>
      <if test="cardName != null">
        card_name,
      </if>
      <if test="cardRes != null">
        card_res,
      </if>
      <if test="couponsType != null">
        coupons_type,
      </if>
      <if test="useRule != null">
        use_rule,
      </if>
      <if test="discValue != null">
        disc_value,
      </if>
      <if test="useRange != null">
        use_range,
      </if>
      <if test="isSuperpUse != null">
        is_superp_use,
      </if>
      <if test="beginTime != null">
        begin_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="cardState != null">
        card_state,
      </if>
      <if test="cardRemarks != null">
        card_remarks,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createName != null">
        create_name,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modifyEmpid != null">
        modify_empid,
      </if>
      <if test="modifyName != null">
        modify_name,
      </if>
      <if test="modifyDate != null">
        modify_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardNo != null">
        #{cardNo,jdbcType=VARCHAR},
      </if>
      <if test="cardName != null">
        #{cardName,jdbcType=VARCHAR},
      </if>
      <if test="cardRes != null">
        #{cardRes,jdbcType=INTEGER},
      </if>
      <if test="couponsType != null">
        #{couponsType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        #{useRule,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="useRange != null">
        #{useRange,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="beginTime != null">
        #{beginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cardState != null">
        #{cardState,jdbcType=INTEGER},
      </if>
      <if test="cardRemarks != null">
        #{cardRemarks,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        #{createName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyEmpid != null">
        #{modifyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modifyName != null">
        #{modifyName,jdbcType=VARCHAR},
      </if>
      <if test="modifyDate != null">
        #{modifyDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TActivityCouponRule">
    update t_activity_coupon_rule
    <set>
      <if test="cardNo != null">
        card_no = #{cardNo,jdbcType=VARCHAR},
      </if>
      <if test="cardName != null">
        card_name = #{cardName,jdbcType=VARCHAR},
      </if>
      <if test="cardRes != null">
        card_res = #{cardRes,jdbcType=INTEGER},
      </if>
      <if test="couponsType != null">
        coupons_type = #{couponsType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        use_rule = #{useRule,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        disc_value = #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="useRange != null">
        use_range = #{useRange,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="beginTime != null">
        begin_time = #{beginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        end_time = #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cardState != null">
        card_state = #{cardState,jdbcType=INTEGER},
      </if>
      <if test="cardRemarks != null">
        card_remarks = #{cardRemarks,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        create_name = #{createName,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyEmpid != null">
        modify_empid = #{modifyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modifyName != null">
        modify_name = #{modifyName,jdbcType=VARCHAR},
      </if>
      <if test="modifyDate != null">
        modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TActivityCouponRule">
    update t_activity_coupon_rule
    set card_no = #{cardNo,jdbcType=VARCHAR},
      card_name = #{cardName,jdbcType=VARCHAR},
      card_res = #{cardRes,jdbcType=INTEGER},
      coupons_type = #{couponsType,jdbcType=INTEGER},
      use_rule = #{useRule,jdbcType=INTEGER},
      disc_value = #{discValue,jdbcType=VARCHAR},
      use_range = #{useRange,jdbcType=INTEGER},
      is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      begin_time = #{beginTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      card_state = #{cardState,jdbcType=INTEGER},
      card_remarks = #{cardRemarks,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modify_empid = #{modifyEmpid,jdbcType=VARCHAR},
      modify_name = #{modifyName,jdbcType=VARCHAR},
      modify_date = #{modifyDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>