From daa7c1b49bec0e07aa94ffedcb410ddeed2f4c61 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 21 一月 2025 10:26:19 +0800
Subject: [PATCH] 取水统合数据功能部分实现
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml | 49 +++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
index aac929f..fbed989 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
@@ -157,7 +157,7 @@
1 AS auditStatus
FROM se_card_operate ope
INNER JOIN ba_user us ON ope.operator = us.id
- WHERE Date(ope.operate_dt) = #{operateDate}
+ WHERE Date(ope.operate_dt) = #{operateDate} AND ope.operate_valid = 2
GROUP BY ope.operator, Date(ope.operate_dt)
UNION ALL
@@ -250,9 +250,10 @@
<!--鑾峰彇鎸囧畾鏃ユ湡銆佹寚瀹氭敹閾跺憳銆佹寚瀹氭敮浠樻柟寮忓疄鏀堕噾棰濆悎璁�-->
<select id="getPaymentSums" resultType="java.lang.Float">
SELECT
- SUM(ope.trade_amount) AS tradeAmount
+ (SUM(ope.trade_amount) + SUM(ope.card_cost)) AS tradeAmount
FROM se_card_operate ope
<where>
+ AND ope.operate_valid = 2
<if test = "tradeDate != null and tradeDate !=''">
AND Date(ope.operate_dt) = #{tradeDate}
</if>
@@ -265,7 +266,7 @@
AND ope.operator = #{cashierId}
</if>
</where>
- GROUP BY ope.payment_id, Date(ope.operate_dt)
+<!-- GROUP BY ope.payment_id, Date(ope.operate_dt)-->
</select>
<!-- 璐㈠姟瀵硅处瀹℃牳椤碉紝鏀堕摱鍛�+鏃ユ湡鍒嗙粍锛屾帓闄や氦鏄撶被鍨嬪垎缁勶紝璁板綍鏁�-->
@@ -286,17 +287,48 @@
<!--寮�鍗$郴缁熶氦鏄撶粺璁★紝鏀堕摱鍛�+鏃ユ湡+绫诲瀷鍒嗙粍-->
<select id="getSummaries" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics">
- SELECT * FROM v_trade_summary
+ SELECT
+ CASE
+ WHEN ope.operate_type = 1 THEN '寮�鍗�'
+ WHEN ope.operate_type = 2 THEN '鍏呭��'
+ WHEN ope.operate_type = 3 THEN '閿�鍗�'
+ WHEN ope.operate_type = 4 THEN '琛ュ崱'
+ WHEN ope.operate_type = 5 THEN '杩旇繕'
+ WHEN ope.operate_type = 10 THEN '鍙嶅啓'
+ END AS operateType,
+ Date(ope.operate_dt) AS tradeDate,
+ COUNT(*) AS count,
+ (IFNULL(SUM(ope.trade_amount), 0) + IFNULL(SUM(ope.card_cost), 0)) AS received,
+ IFNULL(SUM(ope.gift), 0) AS gift,
+ IFNULL(sum(ope.refund_amount),0) AS refundAmount,
+ us.id AS cashierId
+ FROM se_card_operate ope
+ INNER JOIN ba_user us ON us.id = ope.operator
<where>
+ AND ope.operate_type IN(1,2,3,4,5,10)
+ AND ope.operate_valid = 2
<if test = "cashierId != null and cashierId > 0">
- AND cashierId = #{cashierId}
+ AND us.id = #{cashierId}
</if>
<if test = "timeStart != null and timeStop != null">
- AND Date(tradeDate) BETWEEN #{timeStart} AND #{timeStop}
+ AND Date(ope.operate_dt) BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
+ GROUP BY ope.operate_type, Date(ope.operate_dt), us.id
ORDER BY tradeDate
+
+<!-- SELECT * FROM v_trade_summary-->
+<!-- <where>-->
+<!-- <if test = "cashierId != null and cashierId > 0">-->
+<!-- AND cashierId = #{cashierId}-->
+<!-- </if>-->
+
+<!-- <if test = "timeStart != null and timeStop != null">-->
+<!-- AND Date(tradeDate) BETWEEN #{timeStart} AND #{timeStop}-->
+<!-- </if>-->
+<!-- </where>-->
+<!-- ORDER BY tradeDate-->
</select>
<!-- 鏍规嵁鏀堕摱鍛業D鍙婃棩鏈熻幏鍙栬储鍔″璐浜ゆ槗鏄庣粏璁板綍鏁�-->
@@ -334,4 +366,9 @@
</if>
</trim>
</select>
+ <!-- 鍒犻櫎浠婂ぉ鐨勬�昏处-->
+ <delete id="deleteTodayGeneral">
+ DELETE FROM se_general
+ WHERE operate_date = DATE(NOW())
+ </delete>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0