PointAdjustMapper.xml 9.65 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.PointAdjustMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ADJ_ID" property="adjId" jdbcType="VARCHAR" />
    <result column="ACT_ID" property="actId" jdbcType="BIGINT" />
    <result column="PNT_TYPE" property="pntType" jdbcType="VARCHAR" />
    <result column="BLC_ACT" property="blcAct" jdbcType="BIGINT" />
    <result column="DEF_DAYS" property="defDays" jdbcType="INTEGER" />
    <result column="APRO_STAT" property="aproStat" jdbcType="TINYINT" />
    <result column="OPT_STAT" property="optStat" jdbcType="TINYINT" />
    <result column="TOTAL_NUM" property="totalNum" jdbcType="BIGINT" />
    <result column="FAILED_NUM" property="failedNum" jdbcType="BIGINT" />
    <result column="ENABLE" property="enable" jdbcType="BIT" />
    <result column="REC_TIME" property="recTime" jdbcType="TIMESTAMP" />
    <result column="REC_USER" property="recUser" jdbcType="BIGINT" />
    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    `ADJ_ID`, `ACT_ID`, `PNT_TYPE`, `BLC_ACT`, `DEF_DAYS`, `APRO_STAT`, `OPT_STAT`, `TOTAL_NUM`, 
    `FAILED_NUM`, `ENABLE`, `REC_TIME`, `REC_USER`, `REMARK`
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from crm_point_adjust
    where `ADJ_ID` = #{adjId,jdbcType=VARCHAR}
  </select>
  <!-- 查询对应积点单下面的用户总条数 -->
  <select id="selectCount" parameterType="cn.runsa.crmapp.points.entity.PointAdjust" resultType="java.lang.Integer">
  	SELECT 
  	COUNT(*) 
  	FROM crm_point_adjust_detail 
  	 where `ADJ_ID`= #{adjId,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_point_adjust
    where `ADJ_ID` = #{adjId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert"  parameterType="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_point_adjust (`ADJ_ID`, `ACT_ID`, `PNT_TYPE`, 
      `BLC_ACT`, `DEF_DAYS`, `APRO_STAT`, 
      `OPT_STAT`, `TOTAL_NUM`, `FAILED_NUM`, 
      `ENABLE`, `REC_TIME`, `REC_USER`, 
      `REMARK`)
    values (#{adjId,jdbcType=VARCHAR}, #{actId,jdbcType=BIGINT}, #{pntType,jdbcType=VARCHAR}, 
      #{blcAct,jdbcType=BIGINT}, #{defDays,jdbcType=INTEGER}, #{aproStat,jdbcType=TINYINT}, 
      #{optStat,jdbcType=TINYINT}, #{totalNum,jdbcType=BIGINT}, #{failedNum,jdbcType=BIGINT}, 
      #{enable,jdbcType=BIT}, #{recTime,jdbcType=TIMESTAMP}, #{recUser,jdbcType=BIGINT}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective"  parameterType="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_point_adjust
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="adjId != null" >
        `ADJ_ID`,
      </if>
      <if test="actId != null" >
        `ACT_ID`,
      </if>
      <if test="pntType != null" >
        `PNT_TYPE`,
      </if>
      <if test="blcAct != null" >
        `BLC_ACT`,
      </if>
      <if test="defDays != null" >
        `DEF_DAYS`,
      </if>
      <if test="aproStat != null" >
        `APRO_STAT`,
      </if>
      <if test="optStat != null" >
        `OPT_STAT`,
      </if>
      <if test="totalNum != null" >
        `TOTAL_NUM`,
      </if>
      <if test="failedNum != null" >
        `FAILED_NUM`,
      </if>
      <if test="enable != null" >
        `ENABLE`,
      </if>
      <if test="recTime != null" >
        `REC_TIME`,
      </if>
      <if test="recUser != null" >
        `REC_USER`,
      </if>
      <if test="remark != null" >
        `REMARK`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="adjId != null" >
        #{adjId,jdbcType=VARCHAR},
      </if>
      <if test="actId != null" >
        #{actId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null" >
        #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="blcAct != null" >
        #{blcAct,jdbcType=BIGINT},
      </if>
      <if test="defDays != null" >
        #{defDays,jdbcType=INTEGER},
      </if>
      <if test="aproStat != null" >
        #{aproStat,jdbcType=TINYINT},
      </if>
      <if test="optStat != null" >
        #{optStat,jdbcType=TINYINT},
      </if>
      <if test="totalNum != null" >
        #{totalNum,jdbcType=BIGINT},
      </if>
      <if test="failedNum != null" >
        #{failedNum,jdbcType=BIGINT},
      </if>
      <if test="enable != null" >
        #{enable,jdbcType=BIT},
      </if>
      <if test="recTime != null" >
        #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        #{recUser,jdbcType=BIGINT},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_point_adjust
    <set >
      <if test="actId != null" >
        `ACT_ID` = #{actId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null" >
        `PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="blcAct != null" >
        `BLC_ACT` = #{blcAct,jdbcType=BIGINT},
      </if>
      <if test="defDays != null" >
        `DEF_DAYS` = #{defDays,jdbcType=INTEGER},
      </if>
      <if test="aproStat != null" >
        `APRO_STAT` = #{aproStat,jdbcType=TINYINT},
      </if>
      <if test="optStat != null" >
        `OPT_STAT` = #{optStat,jdbcType=TINYINT},
      </if>
      <if test="totalNum != null" >
        `TOTAL_NUM` = #{totalNum,jdbcType=BIGINT},
      </if>
      <if test="failedNum != null" >
        `FAILED_NUM` = #{failedNum,jdbcType=BIGINT},
      </if>
      <if test="enable != null" >
        `ENABLE` = #{enable,jdbcType=BIT},
      </if>
      <if test="recTime != null" >
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        `REC_USER` = #{recUser,jdbcType=BIGINT},
      </if>
      <if test="remark != null" >
        `REMARK` = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where `ADJ_ID` = #{adjId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_point_adjust
    set `ACT_ID` = #{actId,jdbcType=BIGINT},
      `PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
      `BLC_ACT` = #{blcAct,jdbcType=BIGINT},
      `DEF_DAYS` = #{defDays,jdbcType=INTEGER},
      `APRO_STAT` = #{aproStat,jdbcType=TINYINT},
      `OPT_STAT` = #{optStat,jdbcType=TINYINT},
      `TOTAL_NUM` = #{totalNum,jdbcType=BIGINT},
      `FAILED_NUM` = #{failedNum,jdbcType=BIGINT},
      `ENABLE` = #{enable,jdbcType=BIT},
      `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      `REC_USER` = #{recUser,jdbcType=BIGINT},
      `REMARK` = #{remark,jdbcType=VARCHAR}
    where `ADJ_ID` = #{adjId,jdbcType=VARCHAR}
  </update>
  <update id="updatePointAdjustEnableStat" parameterType="cn.runsa.crmapp.points.entity.PointAdjust">
    UPDATE CRM_POINT_ADJUST T SET T.ENABLE = #{enable} WHERE T.ADJ_ID = #{adjId}
  </update>
  <update id="updateKey" parameterType="cn.runsa.crmapp.points.entity.PointAdjust" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update crm_point_adjust
    <set >
      <if test="actId != null" >
        `ACT_ID` = #{actId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null" >
        `PNT_TYPE` = #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="blcAct != null" >
        `BLC_ACT` = #{blcAct,jdbcType=BIGINT},
      </if>
      <if test="defDays != null" >
        `DEF_DAYS` = #{defDays,jdbcType=INTEGER},
      </if>
      <if test="aproStat != null" >
        `APRO_STAT` = #{aproStat,jdbcType=TINYINT},
      </if>
      <if test="optStat != null" >
        `OPT_STAT` = #{optStat,jdbcType=TINYINT},
      </if>
      <if test="totalNum != null" >
        `TOTAL_NUM` = #{totalNum,jdbcType=BIGINT},
      </if>
      <if test="failedNum != null" >
        `FAILED_NUM` = #{failedNum,jdbcType=BIGINT},
      </if>
      <if test="enable != null" >
        `ENABLE` = #{enable,jdbcType=BIT},
      </if>
      <if test="recTime != null" >
        `REC_TIME` = #{recTime,jdbcType=TIMESTAMP},
      </if>
      <if test="recUser != null" >
        `REC_USER` = #{recUser,jdbcType=BIGINT},
      </if>
      <if test="remark != null" >
        `REMARK` = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where `ADJ_ID` = #{adjId,jdbcType=VARCHAR} and APRO_STAT!=2
  </update>
</mapper>