From dfa9258c8879dbb0d1bfc00d7f939031d0bb623b Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 29 一月 2026 18:32:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New

---
 src/main/resources/mapper/account/AccountIncomeMapper.xml |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/account/AccountIncomeMapper.xml b/src/main/resources/mapper/account/AccountIncomeMapper.xml
index bfb6d73..4acb504 100644
--- a/src/main/resources/mapper/account/AccountIncomeMapper.xml
+++ b/src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -43,7 +43,7 @@
     <select id="report" resultType="com.ruoyi.account.dto.AccountDto2">
         SELECT
         sdd.dict_label typeName,
-        sum(income_money) account
+        ifnull(sum(income_money),0) account
         FROM account_income ai
         left join sys_dict_data sdd on ai.income_type = sdd.dict_value and  sdd.dict_type='income_types'
         where
@@ -56,4 +56,30 @@
         </if>
         group by income_type
     </select>
+    <select id="report1" resultType="java.math.BigDecimal">
+        SELECT
+        ifnull(sum(income_money),0) account
+        FROM account_income ai
+        where
+        income_type=#{dictValue}
+        <if test="dateQueryDto.entryDateStart != null and dateQueryDto.entryDateStart != '' ">
+            AND income_date &gt;= DATE_FORMAT(#{dateQueryDto.entryDateStart},'%Y-%m-%d')
+        </if>
+        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
+            AND income_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
+        </if>
+    </select>
+
+    <select id="selectIncomeStats"
+            resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
+        SELECT DATE_FORMAT(income_date, #{dateFormat}) AS dateStr,
+               IFNULL(SUM(income_money), 0)            AS amount
+        FROM account_income
+        WHERE income_date BETWEEN #{startDate} AND #{endDate}
+          AND business_type = 1
+        GROUP BY dateStr
+        ORDER BY dateStr
+
+    </select>
+
 </mapper>

--
Gitblit v1.9.3