|
|
@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="reserveInt != null "> and reserve_int = #{reserveInt}</if>
|
|
|
<if test="reserveStr != null and reserveStr != ''"> and reserve_str = #{reserveStr}</if>
|
|
|
</where>
|
|
|
+ order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCrmCustomerAnalyzeById" parameterType="Long" resultMap="CrmCustomerAnalyzeResult">
|
|
|
@@ -129,4 +130,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <select id="selectCrmCustomerAnalyzeListAll" resultType="com.fs.crm.domain.CrmCustomerAnalyze">
|
|
|
+ select a.*, c.customer_name as customerName
|
|
|
+ from (SELECT t.*
|
|
|
+ FROM (SELECT id,
|
|
|
+ customer_id,
|
|
|
+ customer_portrait_json,
|
|
|
+ attrition_level,
|
|
|
+ intention_degree,
|
|
|
+ create_time,
|
|
|
+ ROW_NUMBER() OVER ( PARTITION BY customer_id ORDER BY create_time DESC, id DESC ) AS rn
|
|
|
+ FROM crm_customer_analyze) t
|
|
|
+ WHERE t.rn = 1
|
|
|
+ ORDER BY t.create_time desc) a
|
|
|
+ left join crm_customer c on a.customer_id = c.customer_id
|
|
|
+ <where>
|
|
|
+ <if test="customerId != null "> and a.customer_id = #{customerId}</if>
|
|
|
+ <if test="customerName != null and customerName != ''"> and c.customer_name like concat('%', #{customerName}, '%')</if>
|
|
|
+ <if test="customerPortraitJson != null and customerPortraitJson != ''"> and a.customer_portrait_json = #{customerPortraitJson}</if>
|
|
|
+ <if test="communicationAbstract != null and communicationAbstract != ''"> and a.communication_abstract = #{communicationAbstract}</if>
|
|
|
+ <if test="communicationSummary != null and communicationSummary != ''"> and a.communication_summary = #{communicationSummary}</if>
|
|
|
+ <if test="attritionLevel != null "> and a.attrition_level = #{attritionLevel}</if>
|
|
|
+ <if test="attritionLevelPrompt != null and attritionLevelPrompt != ''"> and a.attrition_level_prompt like concat('%', #{attritionLevelPrompt}, '%')</if>
|
|
|
+ <if test="customerFocusJson != null and customerFocusJson != ''"> and a.customer_focus_json = #{customerFocusJson}</if>
|
|
|
+ <if test="intentionDegree != null "> and a.intention_degree = #{intentionDegree}</if>
|
|
|
+ <if test="aiChatRecord != null and aiChatRecord != ''"> and a.ai_chat_record = #{aiChatRecord}</if>
|
|
|
+ <if test="reserveInt != null "> and a.reserve_int = #{reserveInt}</if>
|
|
|
+ <if test="reserveStr != null and reserveStr != ''"> and a.reserve_str = #{reserveStr}</if>
|
|
|
+ </where>
|
|
|
+ order by a.create_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|