RankPolicyMapper.xml 2.81 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.customer.mapper.RankPolicyMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.customer.entity.RankPolicy" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="ACT_ID" property="actId" jdbcType="BIGINT" />
    <result column="RANK_FROM" property="rankFrom" jdbcType="VARCHAR" />
    <result column="PLC_ID" property="plcId" jdbcType="BIGINT" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
    <result column="REC_USER" property="recUser" jdbcType="BIGINT" />
  </resultMap>
  <insert id="insert" parameterType="cn.runsa.crmapp.customer.entity.RankPolicy" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_rank_policy_change (`ACT_ID`, `RANK_FROM`, `PLC_ID`, `REC_TIME`, `REC_USER`)
    values (#{actId,jdbcType=BIGINT}, #{rankFrom,jdbcType=VARCHAR}, 
      #{plcId,jdbcType=BIGINT}, #{recTime,jdbcType=TIMESTAMP}, #{recUser,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.customer.entity.RankPolicy" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_rank_policy_change
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="actId != null" >
        `ACT_ID`,
      </if>
      <if test="rankFrom != null" >
        `RANK_FROM`,
      </if>
      <if test="plcId != null" >
        `PLC_ID`,
      </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="rankFrom != null" >
        #{rankFrom,jdbcType=VARCHAR},
      </if>
      <if test="plcId != null" >
        #{plcId,jdbcType=BIGINT},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        #{recUser,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="selectRankPolicy" parameterType="map" resultMap="BaseResultMap">
  	SELECT c.*
  	FROM crm_rank_policy_change c 
  	WHERE c.`ACT_ID` =#{actId,jdbcType=BIGINT} 
  	AND c.`RANK_FROM` = #{rankFrom,jdbcType=VARCHAR} 
  </select>
  <delete id="removeRankPolicy" parameterType="map">
  	DELETE from crm_rank_policy_change
  	WHERE `ACT_ID` =#{actId,jdbcType=BIGINT} 
  	AND `RANK_FROM` = #{rankFrom,jdbcType=VARCHAR} 
  </delete>
</mapper>