From f01980c0d93183ca28b687455983708596a1ad3e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 03 二月 2026 15:49:04 +0800
Subject: [PATCH] fix: 会议室被占用不能被删除

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

diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index 0ed5eb4..98c2675 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -28,7 +28,8 @@
         pl.approve_user_ids,
         sm.is_white,
         pl.approval_status,
-        pl.payment_method
+        pl.payment_method,
+        pl.remarks
         from purchase_ledger pl
         left join sales_ledger_product slp on slp.sales_ledger_id = pl.id and slp.type=2
         left join product_record pr on pl.id = pr.purchase_ledger_id
@@ -83,4 +84,25 @@
         WHERE
             T1.sales_ledger_product_id = #{id}
     </select>
+
+
+    <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>
\ No newline at end of file

--
Gitblit v1.9.3