This commit is contained in:
Vinjor 2024-11-18 20:02:59 +08:00
parent 7975ac9f46
commit 9f9320f7a0
2 changed files with 49 additions and 0 deletions

View File

@ -39,4 +39,7 @@ public class DlRepairTicketsReqVO extends DlRepairTickets {
/** 当前操作人包含集合,主要用在服务顾问那儿 */
private List<Long> nowRepairIds;
/** 客户来源 */
private String cusFrom;
}

View File

@ -214,6 +214,10 @@
, IF(FIND_IN_SET(drt.now_repair_id, #{map.userIdsStr}) > 0,true,false) AS can_operate
</if>
from dl_repair_tickets drt
<if test="map.cusFrom != null and map.cusFrom!=''">
-- 按客户来源查,需要关联客户表 --
left join base_customer_main bcm ON drt.user_id = bcm.id
</if>
left join dl_repair_titem drti
on drt.id = drti.ticket_id AND drti.deleted = '0'
where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07','06','02')
@ -233,6 +237,25 @@
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
and (drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
</if>
<if test="map.repairType !=null and map.repairType !=''">
AND (drt.repair_type=#{map.repairType})
</if>
<if test="map.cusFrom != null and map.cusFrom!=''">
<choose>
<when test="map.cusFrom == '06'">
-- 公务车,查政企客户 --
AND (bcm.type_code='03')
</when>
<when test="map.cusFrom == '04'">
-- 企业用车,查代办客户 --
AND (bcm.type_code='02')
</when>
<otherwise>
-- 家庭自用车01、客户转介绍02、员工转介绍03、救援转维修05 --
AND (bcm.inviter_type=#{map.cusFrom})
</otherwise>
</choose>
</if>
<choose>
<when test="map.selectType=='special'">
-- 小李用的逻辑--isFinish不需要了 --
@ -315,6 +338,10 @@
<select id="getPageTypeAll" resultMap="APPBaseResultMap">
select drt.*
from dl_repair_tickets drt
<if test="map.cusFrom != null and map.cusFrom!=''">
-- 按客户来源查,需要关联客户表 --
left join base_customer_main bcm ON drt.user_id = bcm.id
</if>
left join dl_repair_titem drti
on drt.id = drti.ticket_id AND drti.deleted = '0'
where drt.deleted = '0'
@ -334,6 +361,25 @@
<if test="map.searchTimeArray != null and map.searchTimeArray.length > 0">
and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}
</if>
<if test="map.repairType !=null and map.repairType !=''">
AND (drt.repair_type=#{map.repairType})
</if>
<if test="map.cusFrom != null and map.cusFrom!=''">
<choose>
<when test="map.cusFrom == '06'">
-- 公务车,查政企客户 --
AND (bcm.type_code='03')
</when>
<when test="map.cusFrom == '04'">
-- 企业用车,查代办客户 --
AND (bcm.type_code='02')
</when>
<otherwise>
-- 家庭自用车01、客户转介绍02、员工转介绍03、救援转维修05 --
AND (bcm.inviter_type=#{map.cusFrom})
</otherwise>
</choose>
</if>
<if test="map.adviserId != null and map.adviserId != ''">
-- 服务顾问查所有的就是服务顾问是自己的 --
and drt.adviser_id = #{map.adviserId}