From e809f5955584e600d8612540ea814977c49774c2 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 27 八月 2025 23:51:54 +0800 Subject: [PATCH] 修改bug --- ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 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 761e58c..200f40c 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 @@ -166,6 +166,9 @@ <if test="orderSource != null and orderSource != ''"> and o.orderSource = #{orderSource} </if> + <if test="payType != null"> + and o.payType = #{payType} + </if> <if test="userName != null and userName != ''"> and o.userName LIKE CONCAT('%',#{userName},'%') </if> @@ -464,4 +467,43 @@ ) as t5 order by t5.successTime desc </select> + + <select id="getDriverPromotionActivity" resultType="com.stylefeng.guns.modular.system.model.DriverRankVo"> + select * + from (select aa.id as driverId, + aa.`name` as driverName, + COUNT(aa.userId) as userNum, + SUM(aa.promotionMoney) as money, + aa.promotionActivityId as activityId + from (select b.id, b.`name`, a.userId, a.promotionMoney, a.promotionActivityId + from t_order_private_car a + left join t_driver b on (a.promotionDriverId = b.id) + where a.successTime is not null and a.promotionActivityId = #{id} + <if test="null != driverName and '' != driverName"> + and b.`name` like concat('%', #{driverName}, '%') + </if> + + UNION ALL + + select b.id, b.`name`, a.userId, a.promotionMoney, a.promotionActivityId + from t_order_taxi a + left join t_driver b on (a.promotionDriverId = b.id) + where a.successTime is not null and a.promotionActivityId = #{id} + <if test="null != driverName and '' != driverName"> + and b.`name` like concat('%', #{driverName}, '%') + </if> + + UNION ALL + + select b.id, b.`name`, a.userId, a.promotionMoney, a.promotionActivityId + from t_order_cross_city a + left join t_driver b on (a.promotionDriverId = b.id) + where a.successTime is not null and a.promotionActivityId = #{id} + <if test="null != driverName and '' != driverName"> + and b.`name` like concat('%', #{driverName}, '%') + </if> + ) as aa + group by aa.id) as datas + order by datas.userNum desc + </select> </mapper> -- Gitblit v1.7.1