|
|
@@ -0,0 +1,114 @@
|
|
|
+<?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="com.fs.crm.mapper.CrmCustomerAnalyzeMapper">
|
|
|
+
|
|
|
+ <resultMap type="CrmCustomerAnalyze" id="CrmCustomerAnalyzeResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="customerId" column="customer_id" />
|
|
|
+ <result property="customerName" column="customer_name" />
|
|
|
+ <result property="customerPortraitJson" column="customer_portrait_json" />
|
|
|
+ <result property="communicationAbstract" column="communication_abstract" />
|
|
|
+ <result property="communicationSummary" column="communication_summary" />
|
|
|
+ <result property="attritionLevel" column="attrition_level" />
|
|
|
+ <result property="customerFocusJson" column="customer_focus_json" />
|
|
|
+ <result property="intentionDegree" column="intention_degree" />
|
|
|
+ <result property="aiChatRecord" column="ai_chat_record" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="reserveInt" column="reserve_int" />
|
|
|
+ <result property="reserveStr" column="reserve_str" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCrmCustomerAnalyzeVo">
|
|
|
+ select id, customer_id, customer_name, customer_portrait_json, communication_abstract, communication_summary, attrition_level, customer_focus_json, intention_degree, ai_chat_record, create_time, remark, reserve_int, reserve_str from crm_customer_analyze
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCrmCustomerAnalyzeList" parameterType="CrmCustomerAnalyze" resultMap="CrmCustomerAnalyzeResult">
|
|
|
+ <include refid="selectCrmCustomerAnalyzeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="customerId != null "> and customer_id = #{customerId}</if>
|
|
|
+ <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
|
+ <if test="customerPortraitJson != null and customerPortraitJson != ''"> and customer_portrait_json = #{customerPortraitJson}</if>
|
|
|
+ <if test="communicationAbstract != null and communicationAbstract != ''"> and communication_abstract = #{communicationAbstract}</if>
|
|
|
+ <if test="communicationSummary != null and communicationSummary != ''"> and communication_summary = #{communicationSummary}</if>
|
|
|
+ <if test="attritionLevel != null "> and attrition_level = #{attritionLevel}</if>
|
|
|
+ <if test="customerFocusJson != null and customerFocusJson != ''"> and customer_focus_json = #{customerFocusJson}</if>
|
|
|
+ <if test="intentionDegree != null "> and intention_degree = #{intentionDegree}</if>
|
|
|
+ <if test="aiChatRecord != null and aiChatRecord != ''"> and ai_chat_record = #{aiChatRecord}</if>
|
|
|
+ <if test="reserveInt != null "> and reserve_int = #{reserveInt}</if>
|
|
|
+ <if test="reserveStr != null and reserveStr != ''"> and reserve_str = #{reserveStr}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCrmCustomerAnalyzeById" parameterType="Long" resultMap="CrmCustomerAnalyzeResult">
|
|
|
+ <include refid="selectCrmCustomerAnalyzeVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCrmCustomerAnalyze" parameterType="CrmCustomerAnalyze" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into crm_customer_analyze
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="customerId != null">customer_id,</if>
|
|
|
+ <if test="customerName != null">customer_name,</if>
|
|
|
+ <if test="customerPortraitJson != null">customer_portrait_json,</if>
|
|
|
+ <if test="communicationAbstract != null">communication_abstract,</if>
|
|
|
+ <if test="communicationSummary != null">communication_summary,</if>
|
|
|
+ <if test="attritionLevel != null">attrition_level,</if>
|
|
|
+ <if test="customerFocusJson != null">customer_focus_json,</if>
|
|
|
+ <if test="intentionDegree != null">intention_degree,</if>
|
|
|
+ <if test="aiChatRecord != null">ai_chat_record,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="reserveInt != null">reserve_int,</if>
|
|
|
+ <if test="reserveStr != null and reserveStr != ''">reserve_str,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="customerId != null">#{customerId},</if>
|
|
|
+ <if test="customerName != null">#{customerName},</if>
|
|
|
+ <if test="customerPortraitJson != null">#{customerPortraitJson},</if>
|
|
|
+ <if test="communicationAbstract != null">#{communicationAbstract},</if>
|
|
|
+ <if test="communicationSummary != null">#{communicationSummary},</if>
|
|
|
+ <if test="attritionLevel != null">#{attritionLevel},</if>
|
|
|
+ <if test="customerFocusJson != null">#{customerFocusJson},</if>
|
|
|
+ <if test="intentionDegree != null">#{intentionDegree},</if>
|
|
|
+ <if test="aiChatRecord != null">#{aiChatRecord},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="reserveInt != null">#{reserveInt},</if>
|
|
|
+ <if test="reserveStr != null and reserveStr != ''">#{reserveStr},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCrmCustomerAnalyze" parameterType="CrmCustomerAnalyze">
|
|
|
+ update crm_customer_analyze
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="customerId != null">customer_id = #{customerId},</if>
|
|
|
+ <if test="customerName != null">customer_name = #{customerName},</if>
|
|
|
+ <if test="customerPortraitJson != null">customer_portrait_json = #{customerPortraitJson},</if>
|
|
|
+ <if test="communicationAbstract != null">communication_abstract = #{communicationAbstract},</if>
|
|
|
+ <if test="communicationSummary != null">communication_summary = #{communicationSummary},</if>
|
|
|
+ <if test="attritionLevel != null">attrition_level = #{attritionLevel},</if>
|
|
|
+ <if test="customerFocusJson != null">customer_focus_json = #{customerFocusJson},</if>
|
|
|
+ <if test="intentionDegree != null">intention_degree = #{intentionDegree},</if>
|
|
|
+ <if test="aiChatRecord != null">ai_chat_record = #{aiChatRecord},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
+ <if test="reserveInt != null">reserve_int = #{reserveInt},</if>
|
|
|
+ <if test="reserveStr != null and reserveStr != ''">reserve_str = #{reserveStr},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCrmCustomerAnalyzeById" parameterType="Long">
|
|
|
+ delete from crm_customer_analyze where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCrmCustomerAnalyzeByIds" parameterType="String">
|
|
|
+ delete from crm_customer_analyze where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|