diff --git a/fw-valhalla-dao/src/main/resources/mapper/ClueTaskMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/ClueTaskMapper.xml index 5c8efca..974f9a4 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/ClueTaskMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/ClueTaskMapper.xml @@ -9,26 +9,26 @@ SELECT t1.id, if(t1.type=3 , t4.plate_no, t3.plate_no) plate_no, if(t1.type=3 , t4.frame_no, t3.frame_no) frame_no, - if(t1.type=3 , t4.mobile, t5.mobile) mobile, - t3.cus_level cus_level, - t2.expires loan_expires, - t1.type type, - t1.follow_user user_id, - t1.follow_user_name follow_user_name, - t1.follow_shop shop_id, - t1.finish_shop finish_shop, - t1.finish_user_name finish_user_name, - t1.create_time start_time, - t3.buy_date buy_date, - t3.insurance_expires insurance_expires, - t3.arrival_time arrival_time, - IFNULL(t1.times, 0) times, - TIMESTAMPDIFF(HOUR, now(), t1.deadline) remaining, - t1.redistribution redistribution, - t1.state state, - t1.close_time close_time, - t1.reason initiative, - t1.group_id group_id + if(t1.type=3 , t4.mobile, t5.mobile) mobile, + t3.cus_level cus_level, + t2.expires loan_expires, + t1.type type, + t1.follow_user user_id, + t1.follow_user_name follow_user_name, + t1.follow_shop shop_id, + t1.finish_shop finish_shop, + t1.finish_user_name finish_user_name, + t1.create_time start_time, + t3.buy_date buy_date, + t3.insurance_expires insurance_expires, + t3.arrival_time arrival_time, + IFNULL(t1.times, 0) times, + TIMESTAMPDIFF(HOUR, now(), t1.deadline) remaining, + t1.redistribution redistribution, + t1.state state, + t1.close_time close_time, + t1.reason initiative, + t1.group_id group_id FROM clue_task t1 left join follow_clue t6 on t1.clue_id=t6.id left join customer t3 on t6.vin = t3.frame_no and t6.group_id = t3.group_id and t3.yn=1 @@ -36,7 +36,7 @@ left join accident_pool t4 on t6.biz_id = t4.id left join customer_loan_info t2 on t6.vin = t2.frame_no and t6.group_id = t2.group_id - t1.group_id = #{condition.groupId} + t1.group_id = #{condition.groupId} and t1.follow_user = #{condition.userId} @@ -44,7 +44,8 @@ and t1.follow_user_name like concat('%',#{condition.userName},'%') - and (t3.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', #{condition.plateNo}, '%')) + and (t3.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', + #{condition.plateNo}, '%')) and t6.vin like concat('%', #{condition.frameNo}, '%') @@ -54,13 +55,13 @@ - and t1.follow_shop in + and t1.follow_shop in #{id} - and t1.state in + and t1.state in #{id} @@ -75,13 +76,19 @@ and t1.create_time >= #{condition.startTime1} - and t1.create_time <= #{condition.startTime2} - - - and t1.close_time >= #{condition.closeTime1} - - - and t1.close_time <= #{condition.closeTime2} + and t1.create_time <= #{condition.startTime2} + + + and ( t1.close_time is null or ( + + + and t1.close_time >= #{condition.closeTime1} + + + and t1.close_time <= #{condition.closeTime2} + + + )) and t1.redistribution = #{condition.redistribution} @@ -112,7 +119,7 @@ left join accident_pool t4 on t6.biz_id = t4.id left join customer_loan_info t2 on t6.vin = t2.frame_no and t6.group_id = t2.group_id - t1.group_id = #{condition.groupId} + t1.group_id = #{condition.groupId} and t1.follow_user = #{condition.userId} @@ -120,7 +127,8 @@ and t1.follow_user_name like concat('%',#{condition.userName},'%') - and (t3.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', #{condition.plateNo}, '%')) + and (t3.plate_no like concat('%', #{condition.plateNo}, '%') or t4.plate_no like concat('%', + #{condition.plateNo}, '%')) and t6.vin like concat('%', #{condition.frameNo}, '%') @@ -130,13 +138,13 @@ - and t1.follow_shop in + and t1.follow_shop in #{id} - and t1.state in + and t1.state in #{id} @@ -151,13 +159,19 @@ and t1.create_time >= #{condition.startTime1} - and t1.create_time <= #{condition.startTime2} - - - and t1.close_time >= #{condition.closeTime1} - - - and t1.close_time <= #{condition.closeTime2} + and t1.create_time <= #{condition.startTime2} + + + and ( t1.close_time is null or ( + + + and t1.close_time >= #{condition.closeTime1} + + + and t1.close_time <= #{condition.closeTime2} + + + )) and t1.redistribution = #{condition.redistribution} @@ -172,17 +186,16 @@ -