CustomercouponMapper.xml 2.54 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.CustomercouponMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.customer.entity.Customercoupon" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="CST_ID" property="cstId" jdbcType="BIGINT" />
    <result column="CPN_ID" property="cpnId" jdbcType="BIGINT" />
    <result column="CST_FROM" property="cstFrom" jdbcType="BIGINT" />
    <result column="RCV_TIME" property="rcvTime" jdbcType="TIMESTAMP" />
    <result column="ENABLE" property="enable" jdbcType="BIT" />
  </resultMap>
  <insert id="insert" parameterType="cn.runsa.crmapp.customer.entity.Customercoupon" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_coupons_customer (`CST_ID`, `CPN_ID`, `CST_FROM`, 
      `RCV_TIME`, `ENABLE`)
    values (#{cstId,jdbcType=BIGINT}, #{cpnId,jdbcType=BIGINT}, #{cstFrom,jdbcType=BIGINT}, 
      #{rcvTime,jdbcType=TIMESTAMP}, #{enable,jdbcType=BIT})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.customer.entity.Customercoupon" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_coupons_customer
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="cstId != null" >
        `CST_ID`,
      </if>
      <if test="cpnId != null" >
        `CPN_ID`,
      </if>
      <if test="cstFrom != null" >
        `CST_FROM`,
      </if>
      <if test="rcvTime != null" >
        `RCV_TIME`,
      </if>
      <if test="enable != null" >
        `ENABLE`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="cstId != null" >
        #{cstId,jdbcType=BIGINT},
      </if>
      <if test="cpnId != null" >
        #{cpnId,jdbcType=BIGINT},
      </if>
      <if test="cstFrom != null" >
        #{cstFrom,jdbcType=BIGINT},
      </if>
      <if test="rcvTime != null" >
        #{rcvTime,jdbcType=TIMESTAMP},
      </if>
      <if test="enable != null" >
        #{enable,jdbcType=BIT},
      </if>
    </trim>
  </insert>
  
  <update id="updateByCustid">
    update crm_customer_weixin
    set `CST_ID` = #{target,jdbcType=BIGINT}
    where `CST_ID` = #{source,jdbcType=BIGINT}
  </update>
</mapper>