From c8e2fab9ae930401aabdd6c2d461aa6b8828829f Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 05 六月 2023 14:56:31 +0800
Subject: [PATCH] 更新支付功能
---
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml | 45 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
index 1790a30..9cc18eb 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
@@ -99,9 +99,6 @@
<if test="driverName != null and driverName != ''">
AND d.name LIKE concat('%',#{driverName},'%')
</if>
- <if test="isException != null">
- AND a.is_exception = #{isException}
- </if>
<if test="roleType != null and roleType == 2">
AND o.branchOfficeId = #{objectId}
</if>
@@ -109,7 +106,7 @@
AND o.agentId = #{objectId}
</if>
</where>
- ORDER BY o.createTime
+ ORDER BY o.createTime DESC
</select>
<select id="getDataStatisticsByYear" resultType="com.stylefeng.guns.modular.system.controller.resp.DataStatisticsOrderYearResp">
SELECT date_format(createTime, '%m') AS `month`,COUNT(id) AS orderCount
@@ -125,17 +122,18 @@
GROUP BY `month`
</select>
<select id="getDataStatisticsOrderCount" resultType="com.stylefeng.guns.modular.system.controller.resp.PerformanceTableResp">
- SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.name AS userName
+ SELECT date_format(o.payTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.userName
FROM t_order o
- LEFT JOIN t_driver d ON o.driverId = d.id
+ LEFT JOIN (SELECT id,name AS userName from t_driver) d ON o.driverId = d.id
<where>
<if test="agentId != null">
AND o.agentId = #{agentId}
</if>
<if test="monthDate != null and monthDate != ''">
- AND date_format(o.createTime, '%Y-%m') LIKE concat('',#{monthDate},'%')
+ AND date_format(o.payTime, '%Y-%m') LIKE concat('',#{monthDate},'%')
</if>
AND (o.`state` = 107 OR o.`state` = 108 OR o.`state` = 109)
+ AND d.userName is not null
</where>
GROUP BY monthTime,userName
ORDER BY amount DESC
@@ -238,8 +236,16 @@
#{id}
</foreach>
</if>
- <if test="type != null">
- AND `state` = #{type}
+ <if test="type == 1">
+ AND `state` = 101
+ </if>
+ <if test="type == 2">
+ AND (`state` = 107
+ OR `state` = 108
+ OR `state` = 109)
+ </if>
+ <if test="type == 3">
+ AND `state` = 301
</if>
<if test="localDate != null">
AND date_format(createTime, '%Y-%m-%d') LIKE concat('',#{localDate},'%')
@@ -344,9 +350,9 @@
GROUP BY `month`
</select>
<select id="getDataStatisticsOrderCountByIds" resultType="com.stylefeng.guns.modular.system.controller.resp.PerformanceTableResp">
- SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.name AS userName
+ SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.userName
FROM t_order o
- LEFT JOIN t_driver d ON o.driverId = d.id
+ LEFT JOIN (SELECT id,name AS userName from t_driver) d ON o.driverId = d.id
<where>
<if test="ids != null and ids.size() > 0">
AND o.agentId IN
@@ -358,6 +364,7 @@
AND date_format(o.createTime, '%Y-%m') LIKE concat('',#{monthDate},'%')
</if>
AND (o.`state` = 107 OR o.`state` = 108 OR o.`state` = 109)
+ AND d.userName is not null
</where>
GROUP BY monthTime,userName
ORDER BY amount DESC
@@ -392,5 +399,21 @@
</where>
GROUP BY `month`
</select>
+ <select id="getValidOrderCount" resultType="java.lang.Integer">
+ select count(id)
+ from t_order
+ <where>
+ <if test="driverId != null">
+ AND driverId = #{driverId}
+ </if>
+ <if test="orderMoney != null">
+ AND orderMoney > #{orderMoney}
+ </if>
+ <if test="month != null">
+ AND DATE_FORMAT(createTime, '%Y-%m') = #{month}
+ </if>
+ AND (`state` = 107 OR `state` = 108 OR `state` = 109)
+ </where>
+ </select>
</mapper>
--
Gitblit v1.7.1