From b497ff41e47f4ebe69b86f13f6972f34f33f4884 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 01 六月 2021 09:35:46 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 85b3db5..a158a89
--- a/java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/FeeDetailServiceDaoImplMapper.xml
@@ -109,10 +109,23 @@
         t.receivable_amount,t.receivable_amount receivableAmount,
         t.cycles,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount receivedAmount,
         t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId ,t.create_time createTime,
-        t.state,d.name stateName,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime
+        t.state,d.name stateName,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime,pfa.`value` importFeeName,pfc.fee_name feeName
         from pay_fee_detail t
+        left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002'
+        left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0'
+        <if test="ownerId != null and ownerId != ''">
+            left join pay_fee_attrs pfao on pfao.fee_id = t.fee_id and pfao.spec_cd = '390007' and pfao.status_cd = '0'
+        </if>
         left join t_dict d on t.state = d.status_cd and d.table_name = 'pay_fee_detail' and d.table_columns = 'state'
         where 1 =1
+        <if test="configId != null and configId != ''">
+            and pf.config_id = #{configId}
+            and pf.payer_obj_id = #{payerObjId}
+        </if>
+        <if test="ownerId != null and ownerId != ''">
+           and pfao.value = #{ownerId}
+        </if>
         <if test="primeRate !=null and primeRate != ''">
             and t.prime_rate= #{primeRate}
         </if>
@@ -148,6 +161,9 @@
         </if>
         <if test="endTime !=null ">
             and t.create_time &lt;= #{endTime}
+        </if>
+        <if test="curYear != null and curYear != ''">
+            and DATE_FORMAT(DATE_SUB(t.end_time,INTERVAL 1 DAY),'%Y') = #{curYear}
         </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
@@ -202,7 +218,20 @@
     <select id="queryFeeDetailsCount" parameterType="Map" resultType="Map">
         select count(1) count
         from pay_fee_detail t
+        <if test="configId != null and configId != ''">
+            inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0'
+        </if>
+        <if test="ownerId != null and ownerId != ''">
+            left join pay_fee_attrs pfa on pfa.fee_id = t.fee_id and pfa.spec_cd = '390007' and pfa.status_cd = '0'
+        </if>
         where 1 =1
+        <if test="configId != null and configId != ''">
+            and pf.config_id = #{configId}
+            and pf.payer_obj_id = #{payerObjId}
+        </if>
+        <if test="ownerId != null and ownerId != ''">
+           and pfa.value = #{ownerId}
+        </if>
         <if test="primeRate !=null and primeRate != ''">
             and t.prime_rate= #{primeRate}
         </if>
@@ -239,6 +268,9 @@
         <if test="endTime !=null ">
             and t.create_time &lt;= #{endTime}
         </if>
+        <if test="curYear != null and curYear != ''">
+            and DATE_FORMAT(DATE_SUB(t.end_time,INTERVAL 1 DAY),'%Y') = #{curYear}
+        </if>
 
 
     </select>

--
Gitblit v1.8.0