From 1129c4394c86d7b44edd47d6e50d3611e92798d1 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期四, 01 二月 2024 21:46:38 +0800
Subject: [PATCH] 2024-02-01 朱宝民 票据接口,金额转大写,财务对账查询接口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml |   80 ++++++++++++++++++++++++++++++++++------
 1 files changed, 68 insertions(+), 12 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 72fcf0f..826c8f0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
@@ -146,17 +146,45 @@
   <!--鏍规嵁浜ゆ槗鏃ユ湡鑾峰彇鎬昏处璁板綍鍒楄〃锛堝緟鐢熸垚鐨勶級  -->
   <select id="getGeneralByOperateDate" resultType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
     SELECT
-        us.id AS cashierId,
-        us.`name` AS cashierName,
-        IFNULL(SUM(ope.trade_amount),0) AS tradeAmount,
-        IFNULL(SUM(ope.gift),0) AS gift,
-        IFNULL((SUM(ope.trade_amount) + SUM(ope.gift)),0) AS totalAmount,
-        Date(ope.operate_dt) AS operateDate,
-        1 AS auditStatus
+      us.id AS cashierId,
+      us.`name` AS cashierName,
+      IFNULL(SUM(ope.trade_amount),0) AS tradeAmount,
+      IFNULL(SUM(ope.gift),0) AS gift,
+      IFNULL((SUM(ope.trade_amount) + SUM(ope.gift)),0) AS totalAmount,
+      Date(ope.operate_dt) AS operateDate,
+      1 AS auditStatus
     FROM se_card_operate ope
-        INNER JOIN ba_user us ON ope.operator = us.id
+      INNER JOIN ba_user us ON ope.operator = us.id
     WHERE Date(ope.operate_dt) = #{operateDate}
     GROUP BY ope.operator, Date(ope.operate_dt)
+
+    UNION ALL
+
+    SELECT
+      1000000 AS cashierId,
+      '寰俊' AS cashierName,
+      IFNULL(SUM(amount), 0) AS tradeAmount,
+      0 AS gift,
+      IFNULL(SUM(amount), 0) AS totalAmount,
+      Date(recharge_time) AS operateDate,
+      1 AS auditStatus
+    FROM se_wallet_recharge
+    WHERE Date(recharge_time) = #{operateDate}
+    GROUP BY Date(recharge_time)
+
+    UNION ALL
+
+    SELECT
+      1000000 AS cashierId,
+      '寰俊' AS cashierName,
+      IFNULL(-SUM(refund_amount), 0) AS tradeAmount,
+      0 AS gift,
+      IFNULL(-SUM(refund_amount), 0) AS totalAmount,
+      Date(audit_time) AS operateDate,
+      1 AS auditStatus
+    FROM se_refund
+    WHERE Date(audit_time) = #{operateDate}
+    GROUP BY Date(audit_time)
   </select>
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎬昏处璁板綍鏁�-->
@@ -271,7 +299,7 @@
     </where>
   </select>
 
-  <!--璐㈠姟瀵硅处瀹℃牳椤碉紝鏀堕摱鍛�+鏃ユ湡鍒嗙粍锛屾帓闄や氦鏄撶被鍨嬪垎缁�-->
+  <!--璐㈠姟瀵硅处瀹℃牳椤碉紝鏀堕摱鍛�+鏃ユ湡+绫诲瀷鍒嗙粍锛屾帓闄や氦鏄撶被鍨嬪垎缁�-->
   <select id="getToAudit" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics">
     SELECT * FROM v_transactionstatistics2
     <where>
@@ -284,8 +312,36 @@
       </if>
     </where>
     ORDER BY tradeDate
-    <if test="pageCurr != null and pageSize != null">
-      LIMIT ${pageCurr}, ${pageSize}
-    </if>
+  </select>
+
+  <!--  鏍规嵁鏀堕摱鍛業D鍙婃棩鏈熻幏鍙栬储鍔″璐浜ゆ槗鏄庣粏璁板綍鏁�-->
+  <select id="getTradeDetailsRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
+    SELECT
+        COUNT(*) AS recordCount
+    FROM v_trade_details
+    <where>
+      <if test = "cashierId != null and cashierId > 0">
+        AND cashierId = ${cashierId}
+      </if>
+
+      <if test = "tradeDate != null">
+        AND tradeDate = #{tradeDate}
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鏀堕摱鍛業D鍙婃棩鏈熻幏鍙栬储鍔″璐浜ゆ槗鏄庣粏璁板綍-->
+  <select id="getTradeDetails" resultType="com.dy.pipIrrGlobal.voSe.VoTradeDetails">
+    SELECT * FROM v_trade_details
+    <where>
+      <if test = "cashierId != null and cashierId > 0">
+        AND cashierId = ${cashierId}
+      </if>
+
+      <if test = "tradeDate != null">
+        AND tradeDate = #{tradeDate}
+      </if>
+    </where>
+    ORDER BY tradeDate
   </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0