|
@@ -57,6 +57,7 @@
|
|
|
(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
|
|
|
+ left join sys_dict sd on c.customer_level_id = sd.id
|
|
|
where
|
|
|
c.company_id = #{companyId} and is_delete = #{isDelete}
|
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
@@ -83,7 +84,21 @@
|
|
|
<if test="customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{customerIndustryId}
|
|
|
</if>
|
|
|
- ORDER BY c.id DESC
|
|
|
+ ORDER BY
|
|
|
+ <choose>
|
|
|
+ <when test="isDesc == null or isDesc == ''">
|
|
|
+ c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 0">
|
|
|
+ sd.seq ASC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 1">
|
|
|
+ sd.seq DESC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ c.id DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
limit #{pageIndex},#{pageFrom}
|
|
|
</select>
|
|
|
<select id="list1" resultType="com.management.platform.entity.Clue">
|
|
@@ -113,6 +128,7 @@
|
|
|
(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
|
|
|
+ left join sys_dict sd on c.customer_level_id = sd.id
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
and (c.incharger_id in
|
|
@@ -142,7 +158,21 @@
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
- ORDER BY c.id DESC
|
|
|
+ ORDER BY
|
|
|
+ <choose>
|
|
|
+ <when test="isDesc == null or isDesc == ''">
|
|
|
+ c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 0">
|
|
|
+ sd.seq ASC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 1">
|
|
|
+ sd.seq DESC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ c.id DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
limit #{clue.pageIndex},#{clue.pageFrom}
|
|
|
</select>
|
|
|
<select id="list2" resultType="com.management.platform.entity.Clue">
|
|
@@ -172,6 +202,7 @@
|
|
|
(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
|
|
|
+ left join sys_dict sd on c.customer_level_id = sd.id
|
|
|
where
|
|
|
c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
|
|
|
and (c.incharger_id = #{userId} or c.incharger_id is null)
|
|
@@ -199,7 +230,21 @@
|
|
|
<if test="clue.customerIndustryId != null">
|
|
|
and c.customer_industry_id = #{clue.customerIndustryId}
|
|
|
</if>
|
|
|
- ORDER BY c.id DESC
|
|
|
+ ORDER BY
|
|
|
+ <choose>
|
|
|
+ <when test="isDesc == null or isDesc == ''">
|
|
|
+ c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 0">
|
|
|
+ sd.seq ASC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <when test="isDesc == 1">
|
|
|
+ sd.seq DESC, c.id DESC
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ c.id DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
limit #{clue.pageIndex},#{clue.pageFrom}
|
|
|
</select>
|
|
|
<select id="getTotal" resultType="java.lang.Integer">
|