From 0b3ff378a9faaf9d7a4831b7f0de67378fe0dfea Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 12:20:15 +0800
Subject: [PATCH] optimize 统计

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

diff --git a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
index 6d4c372..33804a5 100755
--- a/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml
@@ -272,4 +272,63 @@
         </if>
     </select>
 
+    <select id="queryHisOwnerCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from business_building_owner t
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.member_id = #{memberId}
+        and t.community_id = #{communityId}
+    </select>
+
+    <select id="queryHisOwners" parameterType="Map" resultType="Map">
+        select t.operate,t.sex,t.name,t.link,t.remark,t.owner_id ownerId,t.b_id bId,
+        t.age,t.member_id memberId,
+        t.owner_type_cd ownerTypeCd,t.community_id communityId,t.owner_flag ownerFlag,
+        t.id_card idCard,t.state,t.address,t.create_time createTime,uu.`name` userName,t.operate
+        from business_building_owner t
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.member_id = #{memberId}
+        and t.community_id = #{communityId}
+        order by t.create_time desc,t.operate
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
+    <select id="queryHisFeeCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from business_pay_fee t
+        left join  pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.fee_id = #{feeId}
+        and t.community_id = #{communityId}
+    </select>
+
+    <select id="queryHisFees" parameterType="Map" resultType="Map">
+        select t.operate,t.start_time startTime,t.end_time endTime,t.create_time createTime,pfc.fee_name feeName,
+        t.amount,
+        uu.`name` userName
+        from business_pay_fee t
+        left join  pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.fee_id = #{feeId}
+        and t.community_id = #{communityId}
+        order by t.create_time desc,t.operate
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
 </mapper>

--
Gitblit v1.8.0