From 00083c26fde57c0165427ae4cc712d24596fdbc6 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 21 五月 2026 11:09:46 +0800
Subject: [PATCH] refactor(purchase): 删除payment_registration  付款登记  invoice_purchase  发票信息  ticket_registration 来票登记  receipt_payment  回款登记 product_record  采购台账开票记录

---
 src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index f007228..a99d356 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -9,4 +9,23 @@
         SET contract_amount = #{totalTaxInclusiveAmount}
         WHERE id = #{id}
     </update>
-</mapper>
\ No newline at end of file
+    <select id="selectPurchaseStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
+        SELECT DATE_FORMAT(entry_date, #{dateFormat}) as dateStr, IFNULL(SUM(contract_amount), 0) as amount
+        FROM purchase_ledger
+        WHERE entry_date BETWEEN #{startDate} AND #{endDate}
+        GROUP BY dateStr
+    </select>
+
+    <select id="selectTotalPurchaseAmount" resultType="java.math.BigDecimal">
+        SELECT IFNULL(SUM(contract_amount), 0)
+        FROM purchase_ledger
+        <where>
+            <if test="startDate != null and startDate != ''">
+                AND entry_date &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND entry_date &lt;= #{endDate}
+            </if>
+        </where>
+    </select>
+</mapper>

--
Gitblit v1.9.3