CustomerEventItemMapper.xml 2.78 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.CustomerEventItemMapper">
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.customer.entity.CustomerEventItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="CST_ID" jdbcType="BIGINT" property="cstId" />
    <result column="ACT_ID" jdbcType="BIGINT" property="actId" />
    <result column="EVT_ID" jdbcType="VARCHAR" property="evtId" />
    <result column="ACT_SCOPE" jdbcType="VARCHAR" property="actScope" />
    <result column="EVT_TIME" jdbcType="TIMESTAMP" property="evtTime" />
  </resultMap>
  <insert id="insert" parameterType="cn.runsa.crmapp.customer.entity.CustomerEventItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_customer_event_item (`CST_ID`, `ACT_ID`, `EVT_ID`, 
      `ACT_SCOPE`, `EVT_TIME`)
    values (#{cstId,jdbcType=BIGINT}, #{actId,jdbcType=BIGINT}, #{evtId,jdbcType=VARCHAR}, 
      #{actScope,jdbcType=VARCHAR}, #{evtTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.customer.entity.CustomerEventItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_customer_event_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cstId != null">
        `CST_ID`,
      </if>
      <if test="actId != null">
        `ACT_ID`,
      </if>
      <if test="evtId != null">
        `EVT_ID`,
      </if>
      <if test="actScope != null">
        `ACT_SCOPE`,
      </if>
      <if test="evtTime != null">
        `EVT_TIME`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cstId != null">
        #{cstId,jdbcType=BIGINT},
      </if>
      <if test="actId != null">
        #{actId,jdbcType=BIGINT},
      </if>
      <if test="evtId != null">
        #{evtId,jdbcType=VARCHAR},
      </if>
      <if test="actScope != null">
        #{actScope,jdbcType=VARCHAR},
      </if>
      <if test="evtTime != null">
        #{evtTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="selectTimes" parameterType="cn.runsa.crmapp.customer.entity.CustomerEventItem" resultType="java.lang.Integer">
  	SELECT COUNT(*) FROM crm_customer_event_item 
  	WHERE CST_ID = #{cstId,jdbcType=BIGINT} AND ACT_ID = #{actId,jdbcType=BIGINT} AND EVT_ID = #{evtId,jdbcType=VARCHAR} AND ACT_SCOPE = #{actScope,jdbcType=VARCHAR} AND EVT_TIME >= #{evtTime,jdbcType=TIMESTAMP}
  </select>
</mapper>