|
@@ -54,12 +54,24 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="startTime != null and endTime != null ">
|
|
|
and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
and c.clue_name = #{clueName}
|
|
|
</if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and c.phone = #{phone}
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{customerLevelId}
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and c.email = #{email}
|
|
|
+ </if>
|
|
|
<if test="clueSourceId != null">
|
|
|
and c.clue_source_id = #{clueSourceId}
|
|
|
</if>
|
|
@@ -94,7 +106,10 @@
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
and c.incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
- and c.incharger_id is null
|
|
|
+ or c.incharger_id is null
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
|
</if>
|
|
@@ -104,6 +119,15 @@
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and c.phone = #{phone}
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{customerLevelId}
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and c.email = #{email}
|
|
|
+ </if>
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
@@ -133,13 +157,25 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
- and c.incharger_id = #{userId} and c.incharger_id is null
|
|
|
+ and c.incharger_id = #{userId} or c.incharger_id is null
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
|
</if>
|
|
|
<if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
and c.clue_name = #{clue.clueName}
|
|
|
</if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and c.phone = #{phone}
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{customerLevelId}
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and c.email = #{email}
|
|
|
+ </if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
@@ -178,6 +214,9 @@
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
and c.clue_name = #{clueName}
|
|
|
</if>
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="clueSourceId != null">
|
|
|
and c.clue_source_id = #{clueSourceId}
|
|
|
</if>
|
|
@@ -194,6 +233,9 @@
|
|
|
<if test="startTime != null and endTime != null ">
|
|
|
and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
and c.clue_name = #{clueName}
|
|
|
</if>
|
|
@@ -209,6 +251,9 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = 1
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="startTime != null and endTime != null ">
|
|
|
and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
@@ -230,13 +275,25 @@
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
and c.incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
- and c.incharger_id is null
|
|
|
+ or c.incharger_id is null
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
|
</if>
|
|
|
<if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
and c.clue_name = #{clue.clueName}
|
|
|
</if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and c.phone = #{phone}
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{customerLevelId}
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and c.email = #{email}
|
|
|
+ </if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
@@ -250,13 +307,25 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
- and c.incharger_id = #{userId} and c.incharger_id is null
|
|
|
+ <if test="inchargerId != null ">
|
|
|
+ and c.incharger_id =#{inchargerId}
|
|
|
+ </if>
|
|
|
+ and c.incharger_id = #{userId} or c.incharger_id is null
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
|
</if>
|
|
|
<if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
and c.clue_name = #{clue.clueName}
|
|
|
</if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and c.phone = #{phone}
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{customerLevelId}
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and c.email = #{email}
|
|
|
+ </if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|