From 20fb7c22fd9d4a936a2e9f4b003da51a0c2a0217 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 25 四月 2025 18:11:19 +0800
Subject: [PATCH] 修改bug

---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml
index c4589cc..afceb7a 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml
@@ -88,9 +88,18 @@
         SELECT dd.*,c1.name as companyName,c2.name as franchiseeName from t_driver AS dd
         LEFT JOIN t_company as c1 on c1.id = dd.companyId
         LEFT JOIN t_company as c2 on c2.id = dd.franchiseeId
-        LEFT JOIN (SELECT * from t_driver_service where type = 1) as ds on ds.driverId = dd.id
         <where>
-            (dd.companyId = #{companyId} or dd.franchiseeId = #{companyId}) and dd.authState = 2 and dd.state = 2 and (ds.id is not null ) and (dd.carId is not null)
+            dd.id != #{driverId} and dd.authState = 2 and dd.state = 2
+            and dd.id in
+            (
+            select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
+            )
+            and dd.id in (select driverId from t_driver_orders where `type` = #{type})
+            and dd.carId in (select carId from t_car_service where `type` = #{type}
+            <if test="null != serverCarModelId">
+                and serverCarModelId = #{serverCarModelId}
+            </if>
+            )
             <if test="name != null and name != ''">
                 and CONCAT(dd.firstName, ' ', dd.lastName) LIKE CONCAT('%',#{name},'%')
             </if>
@@ -107,9 +116,18 @@
         SELECT dd.*,c1.name as companyName,c2.name as franchiseeName from t_driver AS dd
         LEFT JOIN t_company as c1 on c1.id = dd.companyId
         LEFT JOIN t_company as c2 on c2.id = dd.franchiseeId
-        LEFT JOIN (SELECT * from t_driver_service where type = #{type}) as ds on ds.driverId = dd.id
         <where>
-            (dd.companyId = #{companyId} or dd.franchiseeId = #{companyId}) and dd.authState = 2 and dd.state = 2 and (ds.id is not null ) and (dd.carId is not null)
+            dd.id != #{driverId} and dd.authState = 2 and dd.state = 2
+            and dd.id in
+            (
+            select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
+            )
+            and dd.id in (select driverId from t_driver_orders where `type` = #{type})
+            and dd.carId in (select carId from t_car_service where `type` = #{type}
+            <if test="null != serverCarModelId">
+                and serverCarModelId = #{serverCarModelId}
+            </if>
+            )
             <if test="name != null and name != ''">
                 and CONCAT(dd.firstName, ' ', dd.lastName) LIKE CONCAT('%',#{name},'%')
             </if>

--
Gitblit v1.7.1