diff --git a/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml b/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml index 39946bb0..2595e0a6 100644 --- a/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml +++ b/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml @@ -29,10 +29,15 @@ + -- 查待处理数据 -- select drt.* from dl_repair_tickets drt - where drt.deleted = '0' + where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07') and ( drt.ticket_no like concat('%', #{map.ticketNo}, '%') @@ -199,36 +200,36 @@ ) - and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]} + and (drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}) - - and drt.adviser_id = #{map.adviserId} - - - and drt.is_finish = #{map.isFinish} - - - and (drt.tickets_status = '05') - - - and (drt.now_repair_id in + + + -- 小李用的逻辑 -- + + AND ( drt.is_finish = #{map.isFinish}) + + + AND ( drt.now_repair_id = #{map.nowRepairId}) + + + + -- 正常查询用的逻辑 -- + + -- 查服务顾问 待处理的 工单未完成并且服务顾问是自己的 工单已完成且当前处理人是自己的-- + AND ( drt.is_finish = '0' AND drt.adviser_id = #{map.adviserId} ) + OR (drt.is_finish = '1' AND drt.now_repair_id = #{map.adviserId}) + + + -- 查维修工、总检待处理的 -- + AND (drt.is_finish = '0') + AND (drt.now_repair_id in #{item} ) - - - and ( - - find_in_set(#{item}, drti.repair_ids) > 0 - - ) - - - - - and drt.now_repair_id = #{map.nowRepairId} - + + + order by drt.create_time desc @@ -279,9 +280,11 @@ and drt.create_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]} + -- 服务顾问查所有的就是服务顾问是自己的 -- and drt.adviser_id = #{map.adviserId} + -- 维修工或维修厂长查所有的就是维修人是自己的或者是自己班组内的 -- and ( find_in_set(#{item}, drt.now_repair_id) > 0