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/PayFeeAuditServiceDaoImplMapper.xml | 100 ++++++++++++++++++++++++-------------------------
1 files changed, 49 insertions(+), 51 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index b91ec7b..387b24d
--- a/java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/PayFeeAuditServiceDaoImplMapper.xml
@@ -17,40 +17,39 @@
<!-- 鏌ヨ缂磋垂瀹℃牳淇℃伅 add by wuxw 2018-07-03 -->
<select id="getPayFeeAuditInfo" parameterType="Map" resultType="Map">
- select t.audit_user_id,t.audit_user_id auditUserId,t.audit_user_name,t.audit_user_name
- auditUserName,t.fee_detail_id,t.fee_detail_id feeDetailId,t.status_cd,t.status_cd
- statusCd,t.state,t.message,t.community_id,t.community_id communityId,t.fee_id,t.fee_id feeId,
- t.audit_id auditId
- from pay_fee_audit t
- where 1 =1
- <if test="auditUserId !=null and auditUserId != ''">
- and t.audit_user_id= #{auditUserId}
+ select pf.payer_obj_id payerObjId,pf.payer_obj_type payerObjType,pfc.fee_name feeName,
+ pfd.cycles,pfd.start_time startTime,pfd.end_time endTime,pfd.receivable_amount receivableAmount,
+ pfd.received_amount receivedAmount,pfd.create_time createTime,pfa.state,pfa.message,pfd.remark,
+ pfa.audit_user_name auditUserName,pfd.b_id bId,pf.fee_id feeId,pf.community_id communityId,pfd.detail_id detailId
+ from pay_fee_detail pfd
+ INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
+ inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
+ left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
+ where 1=1
+ and pfd.community_id = #{communityId}
+ and pfd.status_cd = '0'
+ and pfd.state = '1400'
+ <if test="roomId !=null and roomId != ''">
+ and pf.payer_obj_id = #{roomId}
+ and pf.payer_obj_type = '3333'
</if>
- <if test="auditUserName !=null and auditUserName != ''">
- and t.audit_user_name= #{auditUserName}
+ <if test="carId !=null and carId != ''">
+ and pf.payer_obj_id = #{carId}
+ and pf.payer_obj_type = '6666'
</if>
- <if test="feeDetailId !=null and feeDetailId != ''">
- and t.fee_detail_id= #{feeDetailId}
+ <if test="payerObjId !=null and payerObjId != ''">
+ and pf.payer_obj_id = #{payerObjId}
</if>
- <if test="statusCd !=null and statusCd != ''">
- and t.status_cd= #{statusCd}
+ <if test="payerObjType !=null and payerObjType != ''">
+ and pf.payer_obj_type = #{payerObjType}
</if>
- <if test="state !=null and state != ''">
- and t.state= #{state}
+ <if test="state !=null and state != '1010'">
+ and pfa.state = #{state}
</if>
- <if test="message !=null and message != ''">
- and t.message= #{message}
+ <if test="state !=null and state == '1010'">
+ and pfa.state is null
</if>
- <if test="communityId !=null and communityId != ''">
- and t.community_id= #{communityId}
- </if>
- <if test="feeId !=null and feeId != ''">
- and t.fee_id= #{feeId}
- </if>
- <if test="auditId !=null and auditId != ''">
- and t.audit_id= #{auditId}
- </if>
- order by t.create_time desc
+ ORDER BY pfd.create_time desc
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
@@ -94,34 +93,33 @@
<!-- 鏌ヨ缂磋垂瀹℃牳鏁伴噺 add by wuxw 2018-07-03 -->
<select id="queryPayFeeAuditsCount" parameterType="Map" resultType="Map">
select count(1) count
- from pay_fee_audit t
- where 1 =1
- <if test="auditUserId !=null and auditUserId != ''">
- and t.audit_user_id= #{auditUserId}
+ from pay_fee_detail pfd
+ INNER JOIN pay_fee pf on pf.fee_id = pfd.fee_id and pf.community_id = pfd.community_id and pf.status_cd = '0'
+ inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pf.community_id = pfc.community_id and pfc.status_cd = '0'
+ left join pay_fee_audit pfa on pf.fee_id = pfa.fee_id and pfd.detail_id = pfa.fee_detail_id and pfa.status_cd = '0'
+ where 1=1
+ and pfd.community_id = #{communityId}
+ and pfd.status_cd = '0'
+ and pfd.state = '1400'
+ <if test="roomId !=null and roomId != ''">
+ and pf.payer_obj_id = #{roomId}
+ and pf.payer_obj_type = '3333'
</if>
- <if test="auditUserName !=null and auditUserName != ''">
- and t.audit_user_name= #{auditUserName}
+ <if test="carId !=null and carId != ''">
+ and pf.payer_obj_id = #{carId}
+ and pf.payer_obj_type = '6666'
</if>
- <if test="feeDetailId !=null and feeDetailId != ''">
- and t.fee_detail_id= #{feeDetailId}
+ <if test="payerObjId !=null and payerObjId != ''">
+ and pf.payer_obj_id = #{payerObjId}
</if>
- <if test="statusCd !=null and statusCd != ''">
- and t.status_cd= #{statusCd}
+ <if test="payerObjType !=null and payerObjType != ''">
+ and pf.payer_obj_type = #{payerObjType}
</if>
- <if test="state !=null and state != ''">
- and t.state= #{state}
+ <if test="state !=null and state != '1010'">
+ and pfa.state = #{state}
</if>
- <if test="message !=null and message != ''">
- and t.message= #{message}
- </if>
- <if test="communityId !=null and communityId != ''">
- and t.community_id= #{communityId}
- </if>
- <if test="feeId !=null and feeId != ''">
- and t.fee_id= #{feeId}
- </if>
- <if test="auditId !=null and auditId != ''">
- and t.audit_id= #{auditId}
+ <if test="state !=null and state == '1010'">
+ and pfa.state is null
</if>
--
Gitblit v1.8.0