From fb282760979098b49cbd6e62fa0df6b359648aa1 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 31 五月 2023 18:29:10 +0800
Subject: [PATCH] optmize sya

---
 java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml
index 828d6fd..0ec113b 100644
--- a/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml
@@ -952,15 +952,16 @@
 
     <!-- 鎸夌即璐规柟寮忕粺璁� -->
     <select id="getReceivedFeeByPrimeRate" parameterType="Map" resultType="Map">
-        select td.`name`,td.status_cd primeRate,SUM(t.received_amount) receivedAmount
-        from pay_fee_detail t
-        left join t_dict td on td.status_cd = t.prime_rate and td.table_name = 'pay_fee_detail' and td.table_columns = 'prime_rate'
+        select td.`name`,td.status_cd primeRate,ifnull(SUM(t.received_amount),0) receivedAmount
+        from t_dict td
+        left join pay_fee_detail t on td.status_cd = t.prime_rate and t.status_cd = '0'
         where
         1=1
+        and td.table_name = 'pay_fee_detail'
+        and td.table_columns = 'prime_rate'
         and t.community_id = #{communityId}
         and t.create_time &gt; #{startDate}
         and t.create_time &lt; #{endDate}
-        and t.status_cd = '0'
         group by td.status_cd,td.`name`
     </select>
 </mapper>

--
Gitblit v1.8.0