From d0cd9b9d98f2aa7a67c56aecb85044f52dbc9cd8 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 02 四月 2026 16:12:10 +0800
Subject: [PATCH] chore: 数据库端口修改

---
 src/main/resources/mapper/account/AccountExpenseMapper.xml |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/account/AccountExpenseMapper.xml b/src/main/resources/mapper/account/AccountExpenseMapper.xml
index 909f372..e954562 100644
--- a/src/main/resources/mapper/account/AccountExpenseMapper.xml
+++ b/src/main/resources/mapper/account/AccountExpenseMapper.xml
@@ -10,6 +10,12 @@
         <if test="accountExpense.entryDateStart != null and accountExpense.entryDateStart != '' ">
             AND expense_date &gt;= DATE_FORMAT(#{accountExpense.entryDateStart},'%Y-%m-%d')
         </if>
+        <if test=" accountExpense.supplierName != null and accountExpense.supplierName != ''">
+            AND supplier_name like CONCAT('%',#{accountExpense.supplierName},'%')
+        </if>
+        <if test=" accountExpense.invoiceNumber != null and accountExpense.invoiceNumber != ''">
+            AND invoice_number like CONCAT('%',#{accountExpense.invoiceNumber},'%')
+        </if>
         <if test="accountExpense.entryDateEnd != null and accountExpense.entryDateEnd != '' ">
             AND  expense_date &lt;= DATE_FORMAT(#{accountExpense.entryDateEnd},'%Y-%m-%d')
         </if>
@@ -56,4 +62,40 @@
         group by expense_type
     </select>
 
+    <select id="report1" resultType="java.math.BigDecimal">
+        SELECT
+        ifnull(sum(expense_money),0) account
+        FROM account_expense ai
+        where
+        expense_type=#{dictValue}
+        <if test="dateQueryDto.entryDateStart != null and dateQueryDto.entryDateStart != '' ">
+            AND expense_date &gt;= DATE_FORMAT(#{dateQueryDto.entryDateStart},'%Y-%m-%d')
+        </if>
+        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
+            AND expense_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
+        </if>
+    </select>
+
+    <select id="selectAccountExpenseStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
+        SELECT DATE_FORMAT(expense_date, #{dateFormat}) as dateStr, IFNULL(SUM(expense_money), 0) as amount
+        FROM account_expense
+        WHERE expense_date BETWEEN #{startDate} AND #{endDate}
+        GROUP BY dateStr
+    </select>
+
+    <select id="selectExpenseComposition" resultType="com.ruoyi.dto.MapDto">
+        SELECT sdd.dict_label as name, CAST(IFNULL(SUM(ae.expense_money), 0) AS CHAR) as value
+        FROM account_expense ae
+        LEFT JOIN sys_dict_data sdd ON ae.expense_type = sdd.dict_value AND sdd.dict_type = 'expense_types'
+        <where>
+            <if test="startDate != null and startDate != ''">
+                AND ae.expense_date &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND ae.expense_date &lt;= #{endDate}
+            </if>
+        </where>
+        GROUP BY ae.expense_type, sdd.dict_label
+    </select>
+
 </mapper>

--
Gitblit v1.9.3