TActivityDiscountRuleMapper.xml 10.2 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.TActivityDiscountRuleMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TActivityDiscountRule">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="disc_no" jdbcType="VARCHAR" property="discNo" />
    <result column="disc_rule_no" jdbcType="VARCHAR" property="discRuleNo" />
    <result column="disc_rule_name" jdbcType="VARCHAR" property="discRuleName" />
    <result column="disc_terminal_res" jdbcType="INTEGER" property="discTerminalRes" />
    <result column="disc_pay_type" jdbcType="INTEGER" property="discPayType" />
    <result column="dis_car_type" jdbcType="INTEGER" property="disCarType" />
    <result column="disc_value" jdbcType="VARCHAR" property="discValue" />
    <result column="is_t_limit" jdbcType="INTEGER" property="isTLimit" />
    <result column="eff_date" jdbcType="TIME" property="effDate" />
    <result column="exp_date" jdbcType="TIME" property="expDate" />
    <result column="special_day_type" jdbcType="INTEGER" property="specialDayType" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <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, disc_no, disc_rule_no, disc_rule_name, disc_terminal_res, disc_pay_type, dis_car_type, 
    disc_value, is_t_limit, eff_date, exp_date, special_day_type, 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_discount_rule
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_activity_discount_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TActivityDiscountRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_discount_rule (disc_no, disc_rule_no, disc_rule_name, 
      disc_terminal_res, disc_pay_type, dis_car_type, 
      disc_value, is_t_limit, eff_date, 
      exp_date, special_day_type, remarks, 
      data_state, create_empid, create_name, 
      create_date, modify_empid, modify_name, 
      modify_date)
    values (#{discNo,jdbcType=VARCHAR}, #{discRuleNo,jdbcType=VARCHAR}, #{discRuleName,jdbcType=VARCHAR}, 
      #{discTerminalRes,jdbcType=INTEGER}, #{discPayType,jdbcType=INTEGER}, #{disCarType,jdbcType=INTEGER}, 
      #{discValue,jdbcType=VARCHAR}, #{isTLimit,jdbcType=INTEGER}, #{effDate,jdbcType=TIME}, 
      #{expDate,jdbcType=TIME}, #{specialDayType,jdbcType=INTEGER}, #{remarks,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.TActivityDiscountRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_discount_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="discNo != null">
        disc_no,
      </if>
      <if test="discRuleNo != null">
        disc_rule_no,
      </if>
      <if test="discRuleName != null">
        disc_rule_name,
      </if>
      <if test="discTerminalRes != null">
        disc_terminal_res,
      </if>
      <if test="discPayType != null">
        disc_pay_type,
      </if>
      <if test="disCarType != null">
        dis_car_type,
      </if>
      <if test="discValue != null">
        disc_value,
      </if>
      <if test="isTLimit != null">
        is_t_limit,
      </if>
      <if test="effDate != null">
        eff_date,
      </if>
      <if test="expDate != null">
        exp_date,
      </if>
      <if test="specialDayType != null">
        special_day_type,
      </if>
      <if test="remarks != null">
        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="discNo != null">
        #{discNo,jdbcType=VARCHAR},
      </if>
      <if test="discRuleNo != null">
        #{discRuleNo,jdbcType=VARCHAR},
      </if>
      <if test="discRuleName != null">
        #{discRuleName,jdbcType=VARCHAR},
      </if>
      <if test="discTerminalRes != null">
        #{discTerminalRes,jdbcType=INTEGER},
      </if>
      <if test="discPayType != null">
        #{discPayType,jdbcType=INTEGER},
      </if>
      <if test="disCarType != null">
        #{disCarType,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="isTLimit != null">
        #{isTLimit,jdbcType=INTEGER},
      </if>
      <if test="effDate != null">
        #{effDate,jdbcType=TIME},
      </if>
      <if test="expDate != null">
        #{expDate,jdbcType=TIME},
      </if>
      <if test="specialDayType != null">
        #{specialDayType,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        #{remarks,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.TActivityDiscountRule">
    update t_activity_discount_rule
    <set>
      <if test="discNo != null">
        disc_no = #{discNo,jdbcType=VARCHAR},
      </if>
      <if test="discRuleNo != null">
        disc_rule_no = #{discRuleNo,jdbcType=VARCHAR},
      </if>
      <if test="discRuleName != null">
        disc_rule_name = #{discRuleName,jdbcType=VARCHAR},
      </if>
      <if test="discTerminalRes != null">
        disc_terminal_res = #{discTerminalRes,jdbcType=INTEGER},
      </if>
      <if test="discPayType != null">
        disc_pay_type = #{discPayType,jdbcType=INTEGER},
      </if>
      <if test="disCarType != null">
        dis_car_type = #{disCarType,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        disc_value = #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="isTLimit != null">
        is_t_limit = #{isTLimit,jdbcType=INTEGER},
      </if>
      <if test="effDate != null">
        eff_date = #{effDate,jdbcType=TIME},
      </if>
      <if test="expDate != null">
        exp_date = #{expDate,jdbcType=TIME},
      </if>
      <if test="specialDayType != null">
        special_day_type = #{specialDayType,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,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.TActivityDiscountRule">
    update t_activity_discount_rule
    set disc_no = #{discNo,jdbcType=VARCHAR},
      disc_rule_no = #{discRuleNo,jdbcType=VARCHAR},
      disc_rule_name = #{discRuleName,jdbcType=VARCHAR},
      disc_terminal_res = #{discTerminalRes,jdbcType=INTEGER},
      disc_pay_type = #{discPayType,jdbcType=INTEGER},
      dis_car_type = #{disCarType,jdbcType=INTEGER},
      disc_value = #{discValue,jdbcType=VARCHAR},
      is_t_limit = #{isTLimit,jdbcType=INTEGER},
      eff_date = #{effDate,jdbcType=TIME},
      exp_date = #{expDate,jdbcType=TIME},
      special_day_type = #{specialDayType,jdbcType=INTEGER},
      remarks = #{remarks,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>