CustomerGuiderMapper.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.CustomerGuiderMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.customer.entity.CustomerGuider" >
    <!--
      WARNING - @mbggenerated
    -->
    <result column="CST_ID" property="cstId" jdbcType="BIGINT" />
    <result column="GUIDER_ID" property="guiderId" jdbcType="VARCHAR" />
    <result column="SIT_ID" property="sitId" jdbcType="BIGINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
    -->
    `CST_ID`, `GUIDER_ID`,`CST_ID`
  </sql>
  <insert id="insert" parameterType="cn.runsa.crmapp.customer.entity.CustomerGuider" >
    <!--
      WARNING - @mbggenerated
    -->
    insert into crm_customer_guider (CST_ID, GUIDER_ID,SIT_ID)
    values (#{cstId,jdbcType=BIGINT}, #{guiderId,jdbcType=VARCHAR}, #{sitId,jdbcType=VARCHAR})  ON DUPLICATE KEY UPDATE GUIDER_ID = #{guiderId,jdbcType=VARCHAR}
  </insert>
  <insert id="insertIgnore" parameterType="cn.runsa.crmapp.customer.entity.CustomerGuider" >
    insert ignore into crm_customer_guider (CST_ID, GUIDER_ID,SIT_ID)
    values (#{cstId,jdbcType=BIGINT}, #{guiderId,jdbcType=VARCHAR}, #{sitId,jdbcType=VARCHAR})
  </insert>
  <select id="selectCustomerGuider" resultMap="BaseResultMap" parameterType="cn.runsa.crmapp.customer.entity.CustomerGuider" >
    SELECT `CST_ID`, `GUIDER_ID`,`CST_ID` FROM CRM_CUSTOMER_GUIDER WHERE CST_ID = #{cstId,jdbcType=BIGINT} AND GUIDER_ID = #{guiderId,jdbcType=VARCHAR}
  </select>
  <update id="updateCustomerGuider" parameterType="cn.runsa.crmapp.customer.entity.CustomerGuider" >
    UPDATE CRM_CUSTOMER_GUIDER T1 SET T1.GUIDER_ID = #{guiderId,jdbcType=VARCHAR} WHERE T1.CST_ID = #{cstId,jdbcType=BIGINT}
  </update>
  <update id="updateCustomerGuiderToNewGuiderId" parameterType="string">
  	UPDATE CRM_CUSTOMER_GUIDER SET GUIDER_ID = #{1} WHERE GUIDER_ID = #{0}
  </update>
  <delete id="deleteCustomerGuider" parameterType="cn.runsa.crmapp.customer.entity.CustomerGuider">
    delete from crm_customer_guider where CST_ID = #{cstId,jdbcType=BIGINT} and GUIDER_ID = #{guiderId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteCustomerGuiderBySiteId" parameterType="java.lang.Long">
    delete from crm_customer_guider WHERE CST_ID = #{0} AND SIT_ID = #{1}
  </delete>
  <delete id="deleteCustomerGuiderByGuiderId" parameterType="string">
    delete from crm_customer_guider WHERE GUIDER_ID = #{guiderId,jdbcType=VARCHAR}
  </delete>
</mapper>