|
@@ -66,16 +66,16 @@
|
|
|
and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
- and c.clue_name = #{clueName}
|
|
|
+ and c.clue_name LIKE CONCAT('%', #{clueName}, '%')
|
|
|
</if>
|
|
|
<if test="phone != null and phone != '' ">
|
|
|
- and c.phone = #{phone}
|
|
|
+ and c.phone LIKE CONCAT('%', #{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}
|
|
|
+ and c.email LIKE CONCAT('%', #{email}, '%')
|
|
|
</if>
|
|
|
<if test="clueSourceId != null">
|
|
|
and c.clue_source_id = #{clueSourceId}
|
|
@@ -83,6 +83,7 @@
|
|
|
<if test="customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{customerIndustryId}
|
|
|
</if>
|
|
|
+ ORDER BY c.id DESC
|
|
|
limit #{pageIndex},#{pageFrom}
|
|
|
</select>
|
|
|
<select id="list1" resultType="com.management.platform.entity.Clue">
|
|
@@ -114,33 +115,34 @@
|
|
|
from clue c
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
- and c.incharger_id in
|
|
|
+ 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
|
|
|
+ or c.incharger_id is null)
|
|
|
<if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
- and c.incharger_id =#{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}
|
|
|
</if>
|
|
|
<if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
- and c.clue_name = #{clue.clueName}
|
|
|
+ and c.clue_name LIKE CONCAT('%', #{clue.clueName}, '%')
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
|
</if>
|
|
|
<if test="clue.phone != null and clue.phone != '' ">
|
|
|
- and c.phone = #{clue.phone}
|
|
|
+ and c.phone LIKE CONCAT('%', #{clue.phone}, '%')
|
|
|
</if>
|
|
|
<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 = #{clue.email}
|
|
|
+ <if test="clue.email != null and clue.email != '' ">
|
|
|
+ and c.email LIKE CONCAT('%', #{clue.email}, '%')
|
|
|
</if>
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
+ ORDER BY c.id DESC
|
|
|
limit #{clue.pageIndex},#{clue.pageFrom}
|
|
|
</select>
|
|
|
<select id="list2" resultType="com.management.platform.entity.Clue">
|
|
@@ -172,7 +174,7 @@
|
|
|
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
|
|
|
+ and (c.incharger_id = #{userId} or c.incharger_id is null)
|
|
|
<if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
and c.incharger_id =#{clue.inchargerId}
|
|
|
</if>
|
|
@@ -180,16 +182,16 @@
|
|
|
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}
|
|
|
+ and c.clue_name LIKE CONCAT('%', #{clue.clueName}, '%')
|
|
|
</if>
|
|
|
<if test="clue.phone != null and clue.phone != '' ">
|
|
|
- and c.phone = #{clue.phone}
|
|
|
+ and c.phone LIKE CONCAT('%', #{clue.phone}, '%')
|
|
|
</if>
|
|
|
<if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
and c.customer_level_id = #{clue.customerLevelId}
|
|
|
</if>
|
|
|
<if test="clue.email != null and clue.email != '' ">
|
|
|
- and c.email = #{clue.email}
|
|
|
+ and c.email LIKE CONCAT('%', #{clue.email}, '%')
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
@@ -197,105 +199,48 @@
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
+ ORDER BY c.id DESC
|
|
|
limit #{clue.pageIndex},#{clue.pageFrom}
|
|
|
</select>
|
|
|
- <select id="Deleterlist" 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,
|
|
|
- c.email,
|
|
|
- c.customer_industry_id,
|
|
|
- c.customer_level_id,
|
|
|
- c.address,
|
|
|
- c.incharger_id,
|
|
|
- c.remark,
|
|
|
- c.is_delete,
|
|
|
- c.plate1,
|
|
|
- c.plate2,
|
|
|
- c.plate3,
|
|
|
- c.plate4,
|
|
|
- c.plate5,
|
|
|
- c.create_time,
|
|
|
- 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
|
|
|
- <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="inchargerId != null and inchargerId != '' ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
- </if>
|
|
|
- <if test="clueSourceId != null">
|
|
|
- and c.clue_source_id = #{clueSourceId}
|
|
|
- </if>
|
|
|
- <if test="customerIndustryId != null">
|
|
|
- and c.customer_industry_id = #{customerIndustryId}
|
|
|
- </if>
|
|
|
- limit #{pageIndex},#{pageFrom}
|
|
|
- </select>
|
|
|
<select id="getTotal" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
from clue c
|
|
|
where
|
|
|
- c.company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
- <if test="clue.startTime != null and clue.endTime != null ">
|
|
|
- and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
- </if>
|
|
|
- <if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
- </if>
|
|
|
- <if test="clue.clueName != null and clue.clueName != '' ">
|
|
|
- and c.clue_name = #{clueName}
|
|
|
- </if>
|
|
|
- <if test="clue.clueSourceId != null">
|
|
|
- and c.clue_source_id = #{clue.clueSourceId}
|
|
|
- </if>
|
|
|
- <if test="clue.customerIndustryId != null">
|
|
|
- and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="getDeleterTotal" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from clue c
|
|
|
- where
|
|
|
- c.company_id = #{companyId} and is_delete = 1
|
|
|
+ company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
|
- and c.incharger_id =#{inchargerId}
|
|
|
+ and incharger_id = #{inchargerId}
|
|
|
</if>
|
|
|
<if test="startTime != null and endTime != null ">
|
|
|
- and c.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
<if test="clueName != null and clueName != '' ">
|
|
|
- and c.clue_name = #{clueName}
|
|
|
+ and clue_name LIKE CONCAT('%', #{clueName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != '' ">
|
|
|
+ and phone LIKE CONCAT('%', #{phone}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="email != null and email != '' ">
|
|
|
+ and email LIKE CONCAT('%', #{email}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="customerLevelId != null and customerLevelId != '' ">
|
|
|
+ and customer_level_id = #{customerLevelId}
|
|
|
</if>
|
|
|
<if test="clueSourceId != null">
|
|
|
- and c.clue_source_id = #{clueSourceId}
|
|
|
+ and clue_source_id = #{clueSourceId}
|
|
|
</if>
|
|
|
<if test="customerIndustryId != null">
|
|
|
- and c.customer_industry_id = #{customerIndustryId}
|
|
|
+ and customer_industry_id = #{customerIndustryId}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getTotal1" resultType="java.lang.Integer">
|
|
|
- select c.id,
|
|
|
- COUNT(c.company_id)
|
|
|
+ select
|
|
|
+ COUNT(c.id)
|
|
|
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
|
|
|
+ and c.incharger_id is null
|
|
|
<if test="clue.inchargerId != null and clue.inchargerId != '' ">
|
|
|
and c.incharger_id =#{clue.inchargerId}
|
|
|
</if>
|
|
@@ -303,16 +248,13 @@
|
|
|
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}
|
|
|
+ and c.clue_name LIKE CONCAT('%', #{clue.clueName}, '%')
|
|
|
</if>
|
|
|
<if test="clue.phone != null and clue.phone != '' ">
|
|
|
- and c.phone = #{clue.phone}
|
|
|
- </if>
|
|
|
- <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
|
|
|
- and c.customer_level_id = #{clue.customerLevelId}
|
|
|
+ and c.phone LIKE CONCAT('%', #{clue.phone}, '%')
|
|
|
</if>
|
|
|
<if test="clue.email != null and clue.email != '' ">
|
|
|
- and c.email = #{clue.email}
|
|
|
+ and c.email LIKE CONCAT('%', #{clue.email}, '%')
|
|
|
</if>
|
|
|
<if test="clue.clueSourceId != null">
|
|
|
and c.clue_source_id = #{clue.clueSourceId}
|
|
@@ -320,6 +262,9 @@
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
+ <if test="clue.customerLevelId != null">
|
|
|
+ and c.customerLevelId = #{clue.customerLevelId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="getTotal2" resultType="java.lang.Integer">
|
|
|
select
|
|
@@ -330,7 +275,7 @@
|
|
|
<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
|
|
|
+ and c.incharger_id = #{userId} and 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>
|