TActivityPacketRuleMapper.xml 11.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.TActivityPacketRuleMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TActivityPacketRule">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="packet_no" jdbcType="VARCHAR" property="packetNo" />
    <result column="packet_name" jdbcType="VARCHAR" property="packetName" />
    <result column="packet_res" jdbcType="INTEGER" property="packetRes" />
    <result column="packet_type" jdbcType="INTEGER" property="packetType" />
    <result column="use_rule" jdbcType="INTEGER" property="useRule" />
    <result column="is_superp_use" jdbcType="INTEGER" property="isSuperpUse" />
    <result column="use_range" jdbcType="INTEGER" property="useRange" />
    <result column="grant_type" jdbcType="INTEGER" property="grantType" />
    <result column="min_amount" jdbcType="INTEGER" property="minAmount" />
    <result column="max_amount" jdbcType="INTEGER" property="maxAmount" />
    <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="packet_state" jdbcType="INTEGER" property="packetState" />
    <result column="packet_remarks" jdbcType="VARCHAR" property="packetRemarks" />
    <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, packet_no, packet_name, packet_res, packet_type, use_rule, is_superp_use, use_range, 
    grant_type, min_amount, max_amount, begin_time, end_time, packet_state, packet_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_packet_rule
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_activity_packet_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TActivityPacketRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_packet_rule (packet_no, packet_name, packet_res, 
      packet_type, use_rule, is_superp_use, 
      use_range, grant_type, min_amount, 
      max_amount, begin_time, end_time, 
      packet_state, packet_remarks, data_state, 
      create_empid, create_name, create_date, 
      modify_empid, modify_name, modify_date
      )
    values (#{packetNo,jdbcType=VARCHAR}, #{packetName,jdbcType=VARCHAR}, #{packetRes,jdbcType=INTEGER}, 
      #{packetType,jdbcType=INTEGER}, #{useRule,jdbcType=INTEGER}, #{isSuperpUse,jdbcType=INTEGER}, 
      #{useRange,jdbcType=INTEGER}, #{grantType,jdbcType=INTEGER}, #{minAmount,jdbcType=INTEGER}, 
      #{maxAmount,jdbcType=INTEGER}, #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, 
      #{packetState,jdbcType=INTEGER}, #{packetRemarks,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.TActivityPacketRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_activity_packet_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="packetNo != null">
        packet_no,
      </if>
      <if test="packetName != null">
        packet_name,
      </if>
      <if test="packetRes != null">
        packet_res,
      </if>
      <if test="packetType != null">
        packet_type,
      </if>
      <if test="useRule != null">
        use_rule,
      </if>
      <if test="isSuperpUse != null">
        is_superp_use,
      </if>
      <if test="useRange != null">
        use_range,
      </if>
      <if test="grantType != null">
        grant_type,
      </if>
      <if test="minAmount != null">
        min_amount,
      </if>
      <if test="maxAmount != null">
        max_amount,
      </if>
      <if test="beginTime != null">
        begin_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="packetState != null">
        packet_state,
      </if>
      <if test="packetRemarks != null">
        packet_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="packetNo != null">
        #{packetNo,jdbcType=VARCHAR},
      </if>
      <if test="packetName != null">
        #{packetName,jdbcType=VARCHAR},
      </if>
      <if test="packetRes != null">
        #{packetRes,jdbcType=INTEGER},
      </if>
      <if test="packetType != null">
        #{packetType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        #{useRule,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="useRange != null">
        #{useRange,jdbcType=INTEGER},
      </if>
      <if test="grantType != null">
        #{grantType,jdbcType=INTEGER},
      </if>
      <if test="minAmount != null">
        #{minAmount,jdbcType=INTEGER},
      </if>
      <if test="maxAmount != null">
        #{maxAmount,jdbcType=INTEGER},
      </if>
      <if test="beginTime != null">
        #{beginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="packetState != null">
        #{packetState,jdbcType=INTEGER},
      </if>
      <if test="packetRemarks != null">
        #{packetRemarks,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.TActivityPacketRule">
    update t_activity_packet_rule
    <set>
      <if test="packetNo != null">
        packet_no = #{packetNo,jdbcType=VARCHAR},
      </if>
      <if test="packetName != null">
        packet_name = #{packetName,jdbcType=VARCHAR},
      </if>
      <if test="packetRes != null">
        packet_res = #{packetRes,jdbcType=INTEGER},
      </if>
      <if test="packetType != null">
        packet_type = #{packetType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        use_rule = #{useRule,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="useRange != null">
        use_range = #{useRange,jdbcType=INTEGER},
      </if>
      <if test="grantType != null">
        grant_type = #{grantType,jdbcType=INTEGER},
      </if>
      <if test="minAmount != null">
        min_amount = #{minAmount,jdbcType=INTEGER},
      </if>
      <if test="maxAmount != null">
        max_amount = #{maxAmount,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="packetState != null">
        packet_state = #{packetState,jdbcType=INTEGER},
      </if>
      <if test="packetRemarks != null">
        packet_remarks = #{packetRemarks,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.TActivityPacketRule">
    update t_activity_packet_rule
    set packet_no = #{packetNo,jdbcType=VARCHAR},
      packet_name = #{packetName,jdbcType=VARCHAR},
      packet_res = #{packetRes,jdbcType=INTEGER},
      packet_type = #{packetType,jdbcType=INTEGER},
      use_rule = #{useRule,jdbcType=INTEGER},
      is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      use_range = #{useRange,jdbcType=INTEGER},
      grant_type = #{grantType,jdbcType=INTEGER},
      min_amount = #{minAmount,jdbcType=INTEGER},
      max_amount = #{maxAmount,jdbcType=INTEGER},
      begin_time = #{beginTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      packet_state = #{packetState,jdbcType=INTEGER},
      packet_remarks = #{packetRemarks,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>