PointsReceiptMapper.xml 10.5 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.PointsReceiptMapper">
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.PointsReceipt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="CHANNEL" jdbcType="VARCHAR" property="channel" />
    <result column="USR" jdbcType="VARCHAR" property="usr" />
    <result column="TYPE" jdbcType="VARCHAR" property="type" />
    <result column="MODE" jdbcType="TINYINT" property="mode" />
    <result column="BIZ_TYPE" jdbcType="VARCHAR" property="bizType" />
    <result column="BIZ_NO" jdbcType="VARCHAR" property="bizNo" />
    <result column="CST_ID" jdbcType="BIGINT" property="cstId" />
    <result column="ACT_ID" jdbcType="BIGINT" property="actId" />
    <result column="BLC_ID" jdbcType="BIGINT" property="blcId" />
    <result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
    <result column="PNT_VAL" jdbcType="DOUBLE" property="pntVal" />
    <result column="FACT_PRICE" jdbcType="DECIMAL" property="factPrice" />
    <result column="LOCKED" jdbcType="BIT" property="locked" />
    <result column="CONFIRM" jdbcType="BIT" property="confirm" />
    <result column="CONFIRM_TYPE" jdbcType="VARCHAR" property="confirmType" />
    <result column="USR_CONFIRM" jdbcType="TINYINT" property="usrConfirm" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <result column="REC_TIME" jdbcType="TIMESTAMP" property="recTime" />
    <result column="siName" jdbcType="VARCHAR" property="sitName" />
    <result column="PNT_NAME" jdbcType="VARCHAR" property="pntName" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `ID`, `CHANNEL`, `USR`, `TYPE`, `MODE`, `BIZ_TYPE`, `BIZ_NO`, `CST_ID`, `ACT_ID`, 
    `BLC_ID`, `PNT_TYPE`, `PNT_VAL`, `FACT_PRICE`, `LOCKED`, `CONFIRM`, `CONFIRM_TYPE`, 
    `USR_CONFIRM`, `REMARK`, `REC_TIME`
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from crm_points_receipt
    where `ID` = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from crm_points_receipt
    where `ID` = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="cn.runsa.crmapp.points.entity.PointsReceipt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_points_receipt (`ID`, `CHANNEL`, `USR`, 
      `TYPE`, `MODE`, `BIZ_TYPE`, 
      `BIZ_NO`, `CST_ID`, `ACT_ID`, 
      `BLC_ID`, `PNT_TYPE`, `PNT_VAL`, 
      `FACT_PRICE`, `LOCKED`, `CONFIRM`, 
      `CONFIRM_TYPE`, `USR_CONFIRM`, `REMARK`, 
      `REC_TIME`)
    values (#{id,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{usr,jdbcType=VARCHAR}, 
      #{type,jdbcType=VARCHAR}, #{mode,jdbcType=TINYINT}, #{bizType,jdbcType=VARCHAR}, 
      #{bizNo,jdbcType=VARCHAR}, #{cstId,jdbcType=BIGINT}, #{actId,jdbcType=BIGINT}, 
      #{blcId,jdbcType=BIGINT}, #{pntType,jdbcType=VARCHAR}, #{pntVal,jdbcType=DOUBLE}, 
      #{factPrice,jdbcType=DECIMAL}, #{locked,jdbcType=BIT}, #{confirm,jdbcType=BIT}, 
      #{confirmType,jdbcType=VARCHAR}, #{usrConfirm,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, 
      #{recTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.PointsReceipt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_points_receipt
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        `ID`,
      </if>
      <if test="channel != null">
        `CHANNEL`,
      </if>
      <if test="usr != null">
        `USR`,
      </if>
      <if test="type != null">
        `TYPE`,
      </if>
      <if test="mode != null">
        `MODE`,
      </if>
      <if test="bizType != null">
        `BIZ_TYPE`,
      </if>
      <if test="bizNo != null">
        `BIZ_NO`,
      </if>
      <if test="cstId != null">
        `CST_ID`,
      </if>
      <if test="actId != null">
        `ACT_ID`,
      </if>
      <if test="blcId != null">
        `BLC_ID`,
      </if>
      <if test="pntType != null">
        `PNT_TYPE`,
      </if>
      <if test="pntVal != null">
        `PNT_VAL`,
      </if>
      <if test="factPrice != null">
        `FACT_PRICE`,
      </if>
      <if test="locked != null">
        `LOCKED`,
      </if>
      <if test="confirm != null">
        `CONFIRM`,
      </if>
      <if test="confirmType != null">
        `CONFIRM_TYPE`,
      </if>
      <if test="usrConfirm != null">
        `USR_CONFIRM`,
      </if>
      <if test="remark != null">
        `REMARK`,
      </if>
      <if test="recTime != null">
        `REC_TIME`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=VARCHAR},
      </if>
      <if test="usr != null">
        #{usr,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="mode != null">
        #{mode,jdbcType=TINYINT},
      </if>
      <if test="bizType != null">
        #{bizType,jdbcType=VARCHAR},
      </if>
      <if test="bizNo != null">
        #{bizNo,jdbcType=VARCHAR},
      </if>
      <if test="cstId != null">
        #{cstId,jdbcType=BIGINT},
      </if>
      <if test="actId != null">
        #{actId,jdbcType=BIGINT},
      </if>
      <if test="blcId != null">
        #{blcId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null">
        #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="pntVal != null">
        #{pntVal,jdbcType=DOUBLE},
      </if>
      <if test="factPrice != null">
        #{factPrice,jdbcType=DECIMAL},
      </if>
      <if test="locked != null">
        #{locked,jdbcType=BIT},
      </if>
      <if test="confirm != null">
        #{confirm,jdbcType=BIT},
      </if>
      <if test="confirmType != null">
        #{confirmType,jdbcType=VARCHAR},
      </if>
      <if test="usrConfirm != null">
        #{usrConfirm,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        #{recTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.points.entity.PointsReceipt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_points_receipt
    <set>
      <if test="channel != null">
        `CHANNEL` = #{channel,jdbcType=VARCHAR},
      </if>
      <if test="usr != null">
        `USR` = #{usr,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `TYPE` = #{type,jdbcType=VARCHAR},
      </if>
      <if test="mode != null">
        `MODE` = #{mode,jdbcType=TINYINT},
      </if>
      <if test="bizType != null">
        `BIZ_TYPE` = #{bizType,jdbcType=VARCHAR},
      </if>
      <if test="bizNo != null">
        `BIZ_NO` = #{bizNo,jdbcType=VARCHAR},
      </if>
      <if test="cstId != null">
        `CST_ID` = #{cstId,jdbcType=BIGINT},
      </if>
      <if test="actId != null">
        `ACT_ID` = #{actId,jdbcType=BIGINT},
      </if>
      <if test="blcId != null">
        `BLC_ID` = #{blcId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null">
        `PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="pntVal != null">
        `PNT_VAL` = #{pntVal,jdbcType=DOUBLE},
      </if>
      <if test="factPrice != null">
        `FACT_PRICE` = #{factPrice,jdbcType=DECIMAL},
      </if>
      <if test="locked != null">
        `LOCKED` = #{locked,jdbcType=BIT},
      </if>
      <if test="confirm != null">
        `CONFIRM` = #{confirm,jdbcType=BIT},
      </if>
      <if test="confirmType != null">
        `CONFIRM_TYPE` = #{confirmType,jdbcType=VARCHAR},
      </if>
      <if test="usrConfirm != null">
        `USR_CONFIRM` = #{usrConfirm,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        `REMARK` = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where `ID` = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.points.entity.PointsReceipt">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_points_receipt
    set `CHANNEL` = #{channel,jdbcType=VARCHAR},
      `USR` = #{usr,jdbcType=VARCHAR},
      `TYPE` = #{type,jdbcType=VARCHAR},
      `MODE` = #{mode,jdbcType=TINYINT},
      `BIZ_TYPE` = #{bizType,jdbcType=VARCHAR},
      `BIZ_NO` = #{bizNo,jdbcType=VARCHAR},
      `CST_ID` = #{cstId,jdbcType=BIGINT},
      `ACT_ID` = #{actId,jdbcType=BIGINT},
      `BLC_ID` = #{blcId,jdbcType=BIGINT},
      `PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
      `PNT_VAL` = #{pntVal,jdbcType=DOUBLE},
      `FACT_PRICE` = #{factPrice,jdbcType=DECIMAL},
      `LOCKED` = #{locked,jdbcType=BIT},
      `CONFIRM` = #{confirm,jdbcType=BIT},
      `CONFIRM_TYPE` = #{confirmType,jdbcType=VARCHAR},
      `USR_CONFIRM` = #{usrConfirm,jdbcType=TINYINT},
      `REMARK` = #{remark,jdbcType=VARCHAR},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP}
    where `ID` = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectNeedConfirmList" parameterType="java.lang.Long" resultMap="BaseResultMap">
  	SELECT r.`ID`,r.`TYPE`,r.`MODE`,r.`BIZ_TYPE`,r.`BIZ_NO`,r.`CST_ID`,r.`PNT_VAL`,r.`FACT_PRICE`,r.`REMARK`,r.`USR_CONFIRM`,s.`PNT_SET_NAME` AS PNT_NAME,t.`siName`
	FROM crm_points_receipt r
	INNER JOIN crm_points_set s ON (s.`ACT_ID` = r.`ACT_ID` AND s.`PNT_TYPE` = r.`PNT_TYPE`) 
	INNER JOIN mtsite t ON r.`USR` = t.`siCode`
	WHERE CST_ID = #{cstId} AND CONFIRM = FALSE AND CONFIRM_TYPE = 'MP' 
  </select>
</mapper>