RankDiscountMapper.xml 4.98 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="cn.runsa.crmapp.points.mapper.RankDiscountMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.RankDiscount" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="PLCY_ID" property="plcyId" jdbcType="BIGINT" />
    <result column="ACT_ID" property="actId" jdbcType="BIGINT" />
    <result column="RAK_ID" property="rakId" jdbcType="VARCHAR" />
    <result column="MAX_DISCOUNT" property="maxDiscount" jdbcType="DOUBLE" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
    <result column="REC_USER" property="recUser" jdbcType="BIGINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `PLCY_ID`, `ACT_ID`, `RAK_ID`, `MAX_DISCOUNT`, `REC_TIME`, `REC_USER`
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from crm_rank_policy_discount
    where `PLCY_ID` = #{plcyId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from crm_rank_policy_discount
    where `PLCY_ID` = #{plcyId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.points.entity.RankDiscount" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey resultType="java.lang.Long" keyProperty="plcyId" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into crm_rank_policy_discount (`ACT_ID`, `RAK_ID`, `MAX_DISCOUNT`, 
      `REC_TIME`, `REC_USER`)
    values (#{actId,jdbcType=BIGINT}, #{rakId,jdbcType=VARCHAR}, #{maxDiscount,jdbcType=DOUBLE}, 
      #{recTime,jdbcType=TIMESTAMP}, #{recUser,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.RankDiscount" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey resultType="java.lang.Long" keyProperty="plcyId" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into crm_rank_policy_discount
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="actId != null" >
        `ACT_ID`,
      </if>
      <if test="rakId != null" >
        `RAK_ID`,
      </if>
      <if test="maxDiscount != null" >
        `MAX_DISCOUNT`,
      </if>
      <if test="recTime != null" >
        `REC_TIME`,
      </if>
      <if test="recUser != null" >
        `REC_USER`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="actId != null" >
        #{actId,jdbcType=BIGINT},
      </if>
      <if test="rakId != null" >
        #{rakId,jdbcType=VARCHAR},
      </if>
      <if test="maxDiscount != null" >
        #{maxDiscount,jdbcType=DOUBLE},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        #{recUser,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.points.entity.RankDiscount" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_rank_policy_discount
    <set >
      <if test="actId != null" >
        `ACT_ID` = #{actId,jdbcType=BIGINT},
      </if>
      <if test="rakId != null" >
        `RAK_ID` = #{rakId,jdbcType=VARCHAR},
      </if>
      <if test="maxDiscount != null" >
        `MAX_DISCOUNT` = #{maxDiscount,jdbcType=DOUBLE},
      </if>
      <if test="recTime != null" >
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        `REC_USER` = #{recUser,jdbcType=BIGINT},
      </if>
    </set>
    where `PLCY_ID` = #{plcyId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.points.entity.RankDiscount" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_rank_policy_discount
    set `ACT_ID` = #{actId,jdbcType=BIGINT},
      `RAK_ID` = #{rakId,jdbcType=VARCHAR},
      `MAX_DISCOUNT` = #{maxDiscount,jdbcType=DOUBLE},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      `REC_USER` = #{recUser,jdbcType=BIGINT}
    where `PLCY_ID` = #{plcyId,jdbcType=BIGINT}
  </update>
</mapper>