From 3f1dc57d57ef0ceafcc59cd5ce34ff90cfe6d146 Mon Sep 17 00:00:00 2001
From: 1098226878 <1098226878@qq.com>
Date: 星期一, 13 九月 2021 17:06:16 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
index c1bba6a..d5863c5 100755
--- a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
@@ -142,7 +142,8 @@
         configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name
         billTypeName,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees curDegrees,mw.pre_degrees
         preDegrees,
-        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,mw.price mwPrice
+        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,mw.price mwPrice,
+        pfa2.`value` ownerName
         from pay_fee t
         INNER join pay_fee_config pfc on t.config_id = pfc.config_id and
         pfc.status_cd = '0'
@@ -155,6 +156,7 @@
         td4.table_columns = 'bill_type'
         LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
         LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
         left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
         LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
         <if test="ownerId != null and ownerId != ''">
@@ -391,16 +393,18 @@
         t.community_id communityId,
         t.config_id configId,
         t.cur_bill curBill,
+        td.name curBillName,
         c.fee_name feeName
         from bill t
         left join pay_fee_config c on t.config_id = c.config_id and c.community_id = t.community_id and c.status_cd =
         '0'
-        where 1 =1
+        left join t_dict td on td.table_name = 'bill' and td.table_columns = 'cur_bill' and t.cur_bill = td.status_cd
+        where 1 = 1
         <if test="billId !=null and billId != ''">
             and t.bill_id= #{billId}
         </if>
         <if test="billName !=null and billName != ''">
-            and t.bill_name= #{billName}
+            and t.bill_name like '%${billName}%'
         </if>
         <if test="receivable !=null and receivable != ''">
             and t.receivable= #{receivable}
@@ -440,7 +444,7 @@
             and t.bill_id= #{billId}
         </if>
         <if test="billName !=null and billName != ''">
-            and t.bill_name= #{billName}
+            and t.bill_name like '%${billName}%'
         </if>
         <if test="receivable !=null and receivable != ''">
             and t.receivable= #{receivable}
@@ -485,7 +489,8 @@
         t.create_time createTime,
         t.deadline_time deadlineTime,
         pf.payer_obj_id payObjId,
-        td.`name` feeTypeName
+        td.name feeTypeName,
+        td2.name stateName
         from bill_owe_fee t
         <if test="curBill !=null and curBill != ''">
             inner join bill b on t.bill_id = b.bill_id and b.community_id = t.community_id and b.cur_bill = #{curBill}
@@ -493,7 +498,9 @@
         left join pay_fee pf on t.fee_id = pf.fee_id and t.community_id = pf.community_id and pf.status_cd = '0'
         left join t_dict td on pf.fee_type_cd = td.status_cd and td.table_name = 'pay_fee_config' and td.table_columns =
         'fee_type_cd'
-        where 1 =1
+        left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'bill_owe_fee' and td2.table_columns =
+        'state'
+        where 1 = 1
         <if test="oweId !=null and oweId != ''">
             and t.owe_id= #{oweId}
         </if>
@@ -523,7 +530,7 @@
             </foreach>
         </if>
         <if test="ownerName != null and ownerName != ''">
-            and t.owner_name = #{ownerName}
+            and t.owner_name like '%${ownerName}%'
         </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
@@ -564,7 +571,7 @@
             and t.owner_id = #{ownerId}
         </if>
         <if test="ownerName != null and ownerName != ''">
-            and t.owner_name = #{ownerName}
+            and t.owner_name like '%${ownerName}%'
         </if>
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
@@ -850,7 +857,8 @@
     <select id="computeEveryOweFee" parameterType="Map" resultType="Map">
         select pfc.fee_name feeName,pf.fee_id feeId,pf.end_time endTime,pf.payer_obj_id payerObjId,pf.payer_obj_type
         payerObjType,
-        pf.community_id communityId,pfc.computing_formula computingFormula,pfc.computing_formula_text computingFormulaText,
+        pf.community_id communityId,pfc.computing_formula computingFormula,pfc.computing_formula_text
+        computingFormulaText,
         pfc.square_price
         squarePrice,pfc.additional_amount additionalAmount
         from pay_fee pf

--
Gitblit v1.8.0