From 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 28 三月 2025 19:57:56 +0800
Subject: [PATCH] 修改bug

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

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarMapper.xml
index 7a0b05f..84646ae 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarMapper.xml
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarMapper.xml
@@ -55,7 +55,7 @@
 
     <!--根据条件查询车辆列表-->
     <select id="getCarList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
-        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat,dd.`name` as driverName,cc.* from t_car as cc
+        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat,CONCAT(dd.firstName, ' ', dd.lastName) as driverName,cc.* from t_car as cc
         LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId
         LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId
         LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId
@@ -108,7 +108,7 @@
         order by o.id desc
     </select>
     <select id="getCarListAuth" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
-        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat,dd.`name` as driverName,cc.* from t_car as cc
+        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat, ifnull(CONCAT(dd.firstName, ' ', dd.lastName), CONCAT(ee.firstName, ' ', ee.lastName)) as driverName,cc.* from t_car as cc
         LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId
         LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId
         LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId
@@ -118,7 +118,9 @@
         GROUP_CONCAT(case when type = 1 then '专车'
         when type = 4 then '市内小件物流'
         else '' end ) as serverStr,carId from t_car_service GROUP BY carId) as ds on ds.carId = cc.id
-        LEFT JOIN (select * from t_driver where flag != 3) AS dd on dd.carId = cc.id) as o
+        LEFT JOIN (select * from t_driver where flag != 3) AS dd on dd.carId = cc.id
+        LEFT JOIN (select * from t_driver where flag != 3) AS ee on ee.id = cc.driverId
+        ) as o
         <where>
             o.state = 1 and authState=1
             <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
@@ -163,7 +165,7 @@
 
     <!--根据条件查询车辆列表不分页-->
     <select id="getCarListNoPage" resultType="map">
-        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat,dd.`name` as driverName,cc.* from t_car as cc
+        SELECT * FROM (SELECT ds.serverStr,cb.`name` as brandName,cm.`name` as modelName,c1.`name` as companyName,c2.`name` as franchiseeName,cm.seat,CONCAT(dd.firstName, ' ', dd.lastName) as driverName,cc.* from t_car as cc
         LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId
         LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId
         LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId

--
Gitblit v1.7.1