Commit 19cebcff by 翁国栋

查询未跟进时间不对应

parent 58ebe2e5
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -282,7 +282,7 @@ ...@@ -282,7 +282,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%')) AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if> </if>
<if test="unfollowedDays != null and unfollowedDays > 0"> <if test="unfollowedDays != null and unfollowedDays > 0">
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays} AND DATEDIFF(NOW(), last_follow_time) <![CDATA[ <= ]]> #{unfollowedDays}
</if> </if>
<if test="followNumber != null and followNumber > 0"> <if test="followNumber != null and followNumber > 0">
AND ( AND (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment