From dc22724f61e0b792d327fa812895f6dc4fcf129d Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 08 四月 2026 15:04:11 +0800
Subject: [PATCH] fix:groupBy
---
src/main/resources/mapper/account/AccountIncomeMapper.xml | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/account/AccountIncomeMapper.xml b/src/main/resources/mapper/account/AccountIncomeMapper.xml
index 4acb504..3bb4da1 100644
--- a/src/main/resources/mapper/account/AccountIncomeMapper.xml
+++ b/src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -45,16 +45,15 @@
sdd.dict_label typeName,
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
- 1=1
+ LEFT JOIN sys_dict_data sdd ON ai.income_type = sdd.dict_value AND sdd.dict_type = 'income_types'
+ WHERE 1=1
<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>
- group by income_type
+ GROUP BY sdd.dict_label, ai.income_type
</select>
<select id="report1" resultType="java.math.BigDecimal">
SELECT
@@ -76,7 +75,7 @@
IFNULL(SUM(income_money), 0) AS amount
FROM account_income
WHERE income_date BETWEEN #{startDate} AND #{endDate}
- AND business_type = 1
+# AND business_type = 1
GROUP BY dateStr
ORDER BY dateStr
--
Gitblit v1.9.3