From 8b749305a8e8c3f4bf669f6980edf2bbb7bfa9c7 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 24 四月 2026 11:14:34 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro
---
src/main/resources/mapper/account/AccountIncomeMapper.xml | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/account/AccountIncomeMapper.xml b/src/main/resources/mapper/account/AccountIncomeMapper.xml
index bfb6d73..53c8cf3 100644
--- a/src/main/resources/mapper/account/AccountIncomeMapper.xml
+++ b/src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -11,6 +11,13 @@
<if test="accountIncome.entryDateStart != null and accountIncome.entryDateStart != '' ">
AND income_date >= DATE_FORMAT(#{accountIncome.entryDateStart},'%Y-%m-%d')
</if>
+ <if test="accountIncome.customerName != null and accountIncome.customerName != '' ">
+ AND customer_name like CONCAT('%',#{accountIncome.customerName},'%')
+ </if>
+
+ <if test="accountIncome.invoiceNumber != null and accountIncome.invoiceNumber != '' ">
+ AND invoice_number like CONCAT('%',#{accountIncome.invoiceNumber},'%')
+ </if>
<if test="accountIncome.entryDateEnd != null and accountIncome.entryDateEnd != '' ">
AND income_date <= DATE_FORMAT(#{accountIncome.entryDateEnd},'%Y-%m-%d')
</if>
@@ -43,7 +50,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
@@ -54,6 +61,32 @@
<if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
AND income_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
</if>
- group by income_type
+ GROUP BY sdd.dict_label, ai.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 >= DATE_FORMAT(#{dateQueryDto.entryDateStart},'%Y-%m-%d')
+ </if>
+ <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
+ AND income_date <= 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