Pu Zhibing
2025-08-21 2fde2e99c38e8c46f7f7988fce076cc7d16445e4
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
@@ -264,7 +264,7 @@
    <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
        select 1 as type,t1.id orderId,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
@@ -273,6 +273,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -288,9 +291,12 @@
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        union all
        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
        select 2 as type,t1.id orderId,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
@@ -299,6 +305,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -314,10 +323,13 @@
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        union all
        select t1.orderNum,t1.promotionMoney,t1.successTime,t1.payMoney money,t2.activityTitle name,t3.name driverName,t4.nickName userName
        select 3 as type,t1.id orderId,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
@@ -326,6 +338,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -340,6 +355,9 @@
        </if>
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        ) as t5 order by t5.successTime desc
@@ -355,6 +373,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -366,6 +387,9 @@
        </if>
        <if test="driverName != null and driverName != ''">
            and t3.name  like CONCAT('%',#{driverName},'%')
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
@@ -381,6 +405,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -392,6 +419,9 @@
        </if>
        <if test="driverName != null and driverName != ''">
            and t3.name  like CONCAT('%',#{driverName},'%')
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
@@ -408,6 +438,9 @@
        <if test="orderNum != null and orderNum != ''">
            and t1.orderNum  =#{orderNum}
        </if>
        <if test="activityId != null">
            and t1.promotionActivityId  =#{activityId}
        </if>
        <if test="beginTime != null and endTime != null">
            and t1.successTime  between #{beginTime} and #{endTime}
        </if>
@@ -420,6 +453,9 @@
        <if test="driverName != null and driverName != ''">
            and t3.name  like CONCAT('%',#{driverName},'%')
        </if>
        <if test="driverId != null ">
            and t1.promotionDriverId =#{driverId}
        </if>
        <if test="roleType != null and roleType != '' and roleType != 1">
            and t1.companyId = #{objectId}
        </if>