From 9ae66b76fa28b1c9106e5da8f8df18fa0610e3e4 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 31 十月 2023 01:34:09 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml
index d355195..73ed200 100644
--- a/java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/BaseDataStatisticsServiceDaoImplMapper.xml
@@ -338,4 +338,21 @@
         </if>
     </select>
 
+    <select id="getCommunityFeeDetailCount" parameterType="Map" resultType="Map">
+        select * from (
+        select t.community_id communityId,count(1) count,SUM(t.received_amount) receivedAmount from pay_fee_detail t
+        where t.status_cd = '0'
+        and t.state in ('1000','1400','1200')
+        <if test="communityIds !=null ">
+            and t.community_id in
+            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        and t.create_time &gt;= #{startTime}
+        and t.create_time &lt;= #{endTime}
+        group by t.community_id
+        ) a order by a.count desc limit 10
+    </select>
+
 </mapper>

--
Gitblit v1.8.0