From d3f42e78332d6192f457c29d4cb46789d2f1d975 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 28 十一月 2024 15:46:31 +0800
Subject: [PATCH] 修改bug

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

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
index 4c14672..f7aed42 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
@@ -158,18 +158,25 @@
         IFNULL(income2.money,0) as driverIncome,
         CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver,
         CONCAT(cb.`name`,'-',ci.carLicensePlate) as car,
-        cc.`name` as companyName,ot.*
-         FROM t_order_private_car as ot
+        cc.`name` as companyName,ot.*,
+        oc.money as cancelMoney,
+        case when oc.payType = 1 then '手机支付'
+             when oc.payType = 2 then '银行卡支付'
+             when oc.payType = 3 then '余额支付' else '现金支付' end as cancelPayTypeStr
+        FROM t_order_private_car as ot
         LEFT JOIN t_user as ui on ui.id = ot.userId
         LEFT JOIN t_driver as di on di.id = ot.driverId
         LEFT JOIN t_car as ci on ci.id= ot.carId
         LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId
         LEFT JOIN t_company as cc on cc.id = ot.companyId
         LEFT JOIN t_server_carmodel as sc on sc.id = ot.serverCarModelId
-        LEFT JOIN (SELECT ii.money,ii.incomeId,cc.type FROM t_income as ii
-        LEFT JOIN t_company as cc on ii.objectId = cc.id
-        where ii.userType = 1 and ii.type = 2 and ii.orderType = 1) as income1 on income1.incomeId = ot.id
-        LEFT JOIN (SELECT incomeId, money FROM t_income where userType = 2 and type = 2 and orderType = 1) as income2 on income2.incomeId = ot.id
+        LEFT JOIN t_order_cancel as oc on ot.id = oc.orderId and oc.orderType = 1
+        LEFT JOIN (
+            SELECT ii.money,ii.incomeId,cc.type FROM t_income as ii
+            LEFT JOIN t_company as cc on ii.objectId = cc.id
+            where ii.userType = 1 and ii.type != 1 and ii.orderType = 1
+        ) as income1 on income1.incomeId = ot.id
+        LEFT JOIN (SELECT incomeId, money FROM t_income where userType = 2 and type != 1 and orderType = 1) as income2 on income2.incomeId = ot.id
         where ot.id = #{orderId}
     </select>
 

--
Gitblit v1.7.1