|
@@ -33,7 +33,6 @@
|
|
|
<select id="list" resultType="com.management.platform.entity.Clue">
|
|
|
select c.id,
|
|
|
c.company_id,
|
|
|
- (select company_name from company where company_id = c.id) companyName,
|
|
|
c.clue_name,
|
|
|
c.clue_source_id,
|
|
|
c.phone,
|
|
@@ -50,11 +49,17 @@
|
|
|
c.plate4,
|
|
|
c.plate5,
|
|
|
c.create_time,
|
|
|
- c.create_id
|
|
|
+ c.create_id,
|
|
|
+ (select company_name from company where c.company_id = id) companyName,
|
|
|
+ (select name from `user` where id = c.incharger_id) inchargerName,
|
|
|
+ (select name from `user` where id = c.create_id) createName,
|
|
|
+ (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
|
|
|
+ (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
|
|
|
+ (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
- <if test="inchargerId != null ">
|
|
|
+ <if test="inchargerId != null and inchargerId != '' ">
|
|
|
and c.incharger_id =#{inchargerId}
|
|
|
</if>
|
|
|
<if test="startTime != null and endTime != null ">
|
|
@@ -100,14 +105,19 @@
|
|
|
c.plate4,
|
|
|
c.plate5,
|
|
|
c.create_time,
|
|
|
- c.create_id
|
|
|
+ c.create_id,
|
|
|
+ (select name from `user` where id = c.incharger_id) inchargerName,
|
|
|
+ (select name from `user` where id = c.create_id) createName,
|
|
|
+ (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
|
|
|
+ (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
|
|
|
+ (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
|
|
|
from Clue c
|
|
|
where
|
|
|
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}))
|
|
|
or c.incharger_id is null
|
|
|
- <if test="inchargerId != null ">
|
|
|
+ <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
and c.incharger_id =#{inchargerId}
|
|
|
</if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
@@ -119,14 +129,14 @@
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
|
- <if test="phone != null and phone != '' ">
|
|
|
- and c.phone = #{phone}
|
|
|
+ <if test="clue.phone != null and clue.phone != '' ">
|
|
|
+ and c.phone = #{clue.phone}
|
|
|
</if>
|
|
|
- <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
- and c.customer_level_id = #{customerLevelId}
|
|
|
+ <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{clue.customerLevelId}
|
|
|
</if>
|
|
|
<if test="email != null and email != '' ">
|
|
|
- and c.email = #{email}
|
|
|
+ and c.email = #{clue.email}
|
|
|
</if>
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
@@ -153,13 +163,18 @@
|
|
|
c.plate4,
|
|
|
c.plate5,
|
|
|
c.create_time,
|
|
|
- c.create_id
|
|
|
+ c.create_id,
|
|
|
+ (select name from `user` where id = c.incharger_id) inchargerName,
|
|
|
+ (select name from `user` where id = c.create_id) createName,
|
|
|
+ (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
|
|
|
+ (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
|
|
|
+ (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
and c.incharger_id = #{userId} or c.incharger_id is null
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
+ <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
+ and c.incharger_id =#{clue.inchargerId}
|
|
|
</if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
@@ -167,14 +182,14 @@
|
|
|
<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 test="clue.phone != null and clue.phone != '' ">
|
|
|
+ and c.phone = #{clue.phone}
|
|
|
</if>
|
|
|
- <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
- and c.customer_level_id = #{customerLevelId}
|
|
|
+ <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{clue.customerLevelId}
|
|
|
</if>
|
|
|
- <if test="email != null and email != '' ">
|
|
|
- and c.email = #{email}
|
|
|
+ <if test="clue.email != null and clue.email != '' ">
|
|
|
+ and c.email = #{clue.email}
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
@@ -204,7 +219,12 @@
|
|
|
c.plate4,
|
|
|
c.plate5,
|
|
|
c.create_time,
|
|
|
- c.create_id
|
|
|
+ c.create_id,
|
|
|
+ (select name from `user` where id = c.incharger_id) inchargerName,
|
|
|
+ (select name from `user` where id = c.create_id) createName,
|
|
|
+ (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
|
|
|
+ (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
|
|
|
+ (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = 1
|
|
@@ -214,7 +234,7 @@
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
and c.clue_name = #{clueName}
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
+ <if test="inchargerId != null and inchargerId != '' ">
|
|
|
and c.incharger_id =#{inchargerId}
|
|
|
</if>
|
|
|
<if test="clueSourceId != null">
|
|
@@ -230,20 +250,20 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
- <if test="startTime != null and endTime != null ">
|
|
|
+ <if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
+ <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
and c.incharger_id =#{inchargerId}
|
|
|
</if>
|
|
|
- <if test="clueName != null and clueName != '' ">
|
|
|
+ <if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
and c.clue_name = #{clueName}
|
|
|
</if>
|
|
|
- <if test="clueSourceId != null">
|
|
|
- and c.clue_source_id = #{clueSourceId}
|
|
|
+ <if test="clue.clueSourceId != null">
|
|
|
+ and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
|
- <if test="customerIndustryId != null">
|
|
|
- and c.customer_industry_id = #{customerIndustryId}
|
|
|
+ <if test="clue.customerIndustryId != null">
|
|
|
+ and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getDeleterTotal" resultType="java.lang.Integer">
|
|
@@ -251,7 +271,7 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = 1
|
|
|
- <if test="inchargerId != null ">
|
|
|
+ <if test="inchargerId != null and inchargerId != '' ">
|
|
|
and c.incharger_id =#{inchargerId}
|
|
|
</if>
|
|
|
<if test="startTime != null and endTime != null ">
|
|
@@ -276,8 +296,8 @@
|
|
|
and c.incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
or c.incharger_id is null
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
+ <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
+ and c.incharger_id =#{clue.inchargerId}
|
|
|
</if>
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
|
and c.create_time BETWEEN #{clue.startTime} and #{clue.endTime}
|
|
@@ -285,14 +305,14 @@
|
|
|
<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 test="clue.phone != null and clue.phone != '' ">
|
|
|
+ and c.phone = #{clue.phone}
|
|
|
</if>
|
|
|
- <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
- and c.customer_level_id = #{customerLevelId}
|
|
|
+ <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{clue.customerLevelId}
|
|
|
</if>
|
|
|
- <if test="email != null and email != '' ">
|
|
|
- and c.email = #{email}
|
|
|
+ <if test="clue.email != null and clue.email != '' ">
|
|
|
+ and c.email = #{clue.email}
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
@@ -307,8 +327,8 @@
|
|
|
from Clue c
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
+ <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
+ and c.incharger_id =#{clue.inchargerId}
|
|
|
</if>
|
|
|
and c.incharger_id = #{userId} or c.incharger_id is null
|
|
|
<if test="clue.startTime != null and clue.endTime != null ">
|
|
@@ -317,14 +337,14 @@
|
|
|
<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 test="clue.phone != null and clue.phone != '' ">
|
|
|
+ and c.phone = #{clue.phone}
|
|
|
</if>
|
|
|
- <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
- and c.customer_level_id = #{customerLevelId}
|
|
|
+ <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
+ and c.customer_level_id = #{clue.customerLevelId}
|
|
|
</if>
|
|
|
- <if test="email != null and email != '' ">
|
|
|
- and c.email = #{email}
|
|
|
+ <if test="clue.email != null and clue.email != '' ">
|
|
|
+ and c.email = #{clue.email}
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|