TActivityDiscountMapper.xml 9.06 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.TActivityDiscountMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TActivityDiscount">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="disc_no" jdbcType="VARCHAR" property="discNo" />
    <result column="disc_name" jdbcType="VARCHAR" property="discName" />
    <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="disc_res" jdbcType="INTEGER" property="discRes" />
    <result column="disc_type" jdbcType="INTEGER" property="discType" />
    <result column="disc_state" jdbcType="INTEGER" property="discState" />
    <result column="auditor_status" jdbcType="INTEGER" property="auditorStatus" />
    <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, pl_no, disc_no, disc_name, begin_time, end_time, disc_res, disc_type, disc_state, 
    auditor_status, 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
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_activity_discount
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TActivityDiscount">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_discount (pl_no, disc_no, disc_name, 
      begin_time, end_time, disc_res, 
      disc_type, disc_state, auditor_status, 
      remarks, data_state, create_empid, 
      create_name, create_date, modify_empid, 
      modify_name, modify_date)
    values (#{plNo,jdbcType=VARCHAR}, #{discNo,jdbcType=VARCHAR}, #{discName,jdbcType=VARCHAR}, 
      #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{discRes,jdbcType=INTEGER}, 
      #{discType,jdbcType=INTEGER}, #{discState,jdbcType=INTEGER}, #{auditorStatus,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.TActivityDiscount">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_discount
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="discNo != null">
        disc_no,
      </if>
      <if test="discName != null">
        disc_name,
      </if>
      <if test="beginTime != null">
        begin_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="discRes != null">
        disc_res,
      </if>
      <if test="discType != null">
        disc_type,
      </if>
      <if test="discState != null">
        disc_state,
      </if>
      <if test="auditorStatus != null">
        auditor_status,
      </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="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="discNo != null">
        #{discNo,jdbcType=VARCHAR},
      </if>
      <if test="discName != null">
        #{discName,jdbcType=VARCHAR},
      </if>
      <if test="beginTime != null">
        #{beginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="discRes != null">
        #{discRes,jdbcType=INTEGER},
      </if>
      <if test="discType != null">
        #{discType,jdbcType=INTEGER},
      </if>
      <if test="discState != null">
        #{discState,jdbcType=INTEGER},
      </if>
      <if test="auditorStatus != null">
        #{auditorStatus,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.TActivityDiscount">
    update t_activity_discount
    <set>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="discNo != null">
        disc_no = #{discNo,jdbcType=VARCHAR},
      </if>
      <if test="discName != null">
        disc_name = #{discName,jdbcType=VARCHAR},
      </if>
      <if test="beginTime != null">
        begin_time = #{beginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        end_time = #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="discRes != null">
        disc_res = #{discRes,jdbcType=INTEGER},
      </if>
      <if test="discType != null">
        disc_type = #{discType,jdbcType=INTEGER},
      </if>
      <if test="discState != null">
        disc_state = #{discState,jdbcType=INTEGER},
      </if>
      <if test="auditorStatus != null">
        auditor_status = #{auditorStatus,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.TActivityDiscount">
    update t_activity_discount
    set pl_no = #{plNo,jdbcType=VARCHAR},
      disc_no = #{discNo,jdbcType=VARCHAR},
      disc_name = #{discName,jdbcType=VARCHAR},
      begin_time = #{beginTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      disc_res = #{discRes,jdbcType=INTEGER},
      disc_type = #{discType,jdbcType=INTEGER},
      disc_state = #{discState,jdbcType=INTEGER},
      auditor_status = #{auditorStatus,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>