From 6408a348e14193b0f625673d4e4b22b9fbd1e369 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 08 八月 2025 18:10:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml b/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml index 25a7bb1..0f24bf7 100644 --- a/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml +++ b/ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml @@ -341,21 +341,19 @@ td.`name` as driverName, tc1.name as companyName, tc2.name as franchiseeName, - <if test="1 == type"> topc1.num as privateCarTotalNum, IFNULL(topc2.num, 0) as privateCarNotPayNum, IFNULL(topc3.num, 0) as privateCarcancelNum, IFNULL(topc4.taxiMoney, 0) as privateCarTotalMoney, IFNULL(topc5.taxiMoney, 0) as privateCarNotPayMoney, - </if> + IFNULL(topc6.payMoney, 0) as payMoney, td.state as driverState, td.phone as driverPhone FROM t_driver td LEFT JOIN (SELECT id,name FROM t_company WHERE FIND_IN_SET(type, '1,2') AND flag != 3 ) AS tc1 ON td.companyId=tc1.id LEFT JOIN ( SELECT id,name FROM t_company WHERE type = 3 AND flag != 3 ) AS tc2 ON tc2.id = td.franchiseeId - <if test="1 == type"> - INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') + INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') <if test="null != start and '' != start and null != end and '' != end"> and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} </if> @@ -373,7 +371,7 @@ </if> GROUP BY driverId ) AS topc3 ON topc3.driverId = td.id - LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,12') + LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') <if test="null != start and '' != start and null != end and '' != end"> and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} </if> @@ -385,10 +383,19 @@ </if> GROUP BY driverId ) AS topc5 ON topc5.driverId = td.id - </if> + LEFT JOIN ( SELECT SUM(payMoney) AS payMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') + <if test="null != start and '' != start and null != end and '' != end"> + and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} + </if> + GROUP BY driverId + ) AS topc6 ON topc6.driverId = td.id <where> <if test="null!= companyId and '' != companyId"> td.companyId=#{companyId} or td.franchiseeId=#{companyId} + </if> + + <if test="null!= driverName and '' != driverName"> + and td.name LIKE CONCAT('%',#{driverName},'%') </if> </where> </select> @@ -400,21 +407,19 @@ td.`name` as driverName, tc1.name as companyName, tc2.name as franchiseeName, - <if test="1 == type"> topc1.num as privateCarTotalNum, IFNULL(topc2.num, 0) as privateCarNotPayNum, IFNULL(topc3.num, 0) as privateCarcancelNum, IFNULL(topc4.taxiMoney, 0) as privateCarTotalMoney, IFNULL(topc5.taxiMoney, 0) as privateCarNotPayMoney, - </if> + IFNULL(topc6.payMoney, 0) as payMoney, td.state as driverState, td.phone as driverPhone FROM t_driver td LEFT JOIN (SELECT id,name FROM t_company WHERE FIND_IN_SET(type, '1,2') AND flag != 3 ) AS tc1 ON td.companyId=tc1.id LEFT JOIN ( SELECT id,name FROM t_company WHERE type = 3 AND flag != 3 ) AS tc2 ON tc2.id = td.franchiseeId - <if test="1 == type"> - INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,10,12') + INNER JOIN ( SELECT COUNT(id) AS num, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') <if test="null != start and '' != start and null != end and '' != end"> and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} </if> @@ -432,7 +437,7 @@ </if> GROUP BY driverId ) AS topc3 ON topc3.driverId = td.id - LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '7,8,9,12') + LEFT JOIN ( SELECT SUM(orderMoney) AS taxiMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') <if test="null != start and '' != start and null != end and '' != end"> and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} </if> @@ -444,14 +449,21 @@ </if> GROUP BY driverId ) AS topc5 ON topc5.driverId = td.id + LEFT JOIN ( SELECT SUM(payMoney) AS payMoney, driverId FROM t_order_private_car WHERE FIND_IN_SET(state, '8,9') + <if test="null != start and '' != start and null != end and '' != end"> + and DATE_FORMAT(travelTime, '%Y-%m-%d') between #{start} and #{end} </if> + GROUP BY driverId + ) AS topc6 ON topc6.driverId = td.id where 1=1 <if test="null!= companyId and '' != companyId"> and td.companyId=#{companyId} or td.franchiseeId=#{companyId} </if> - <if test="1 == type"> - order by privateCarTotalNum desc,privateCarTotalMoney desc + <if test="null!= driverName and '' != driverName"> + and td.name LIKE CONCAT('%',#{driverName},'%') </if> + order by privateCarTotalNum desc,privateCarTotalMoney desc + </select> -- Gitblit v1.7.1