From 926e065fb0b4424d0d51023c234a92433bac61c8 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 01 八月 2025 11:53:45 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong

---
 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml |  167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 167 insertions(+), 0 deletions(-)

diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
index f0b5ae9..27d4230 100644
--- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
+++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
@@ -259,4 +259,171 @@
         SELECT  IFNULL(amount,0) amount,b.`name`  FROM  t_order_additional_fee a   LEFT JOIN t_additional_fee b ON a.additionalFeeId=b.id  WHERE a.orderId=#{id} AND a.orderType=#{orderType} AND a.id>1 AND amount>0
     </select>
 
+
+
+
+    <select id="promotionInfo" resultType="java.util.Map">
+select  * from (
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_private_car t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+
+        union all
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_taxi t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+
+        union all
+
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_cross_city t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+        ) as t5 order by t5.successTime desc
+
+    </select>
+    <select id="promotionInfoExport" resultType="java.util.Map">
+        select  * from (
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_private_car t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+
+        union all
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_taxi t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+
+        union all
+
+        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
+        from t_order_cross_city t1
+        LEFT JOIN t_driver_promotion_activity t2 ON t1.promotionActivityId = t2.id
+        LEFT JOIN t_driver t3 ON t1.promotionDriverId = t3.id
+        LEFT JOIN t_user t4 ON t1.userId = t4.id
+        where t1.promotionActivityId is not null
+        <if test="orderNum != null and orderNum != ''">
+            and t1.orderNum  =#{orderNum}
+        </if>
+        <if test="beginTime != null and endTime != null">
+            and t1.successTime  between #{beginTime} and #{endTime}
+        </if>
+        <if test="userName != null and userName != ''">
+            and t4.nickName  like CONCAT('%',#{userName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t2.activityTitle  like CONCAT('%',#{name},'%')
+        </if>
+        <if test="driverName != null and driverName != ''">
+            and t3.name  like CONCAT('%',#{driverName},'%')
+        </if>
+        <if test="roleType != null and roleType != '' and roleType != 1">
+            and t1.companyId = #{objectId}
+        </if>
+        ) as t5 order by t5.successTime desc
+    </select>
+
 </mapper>

--
Gitblit v1.7.1