From db7e077ea8f2d995e922bc11b77dc149592a7455 Mon Sep 17 00:00:00 2001
From: yupeng <roc__yu@163.com>
Date: 星期三, 09 四月 2025 12:35:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into xizang-changyun

---
 ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
index b0d10bc..d362ce5 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -63,7 +63,7 @@
             <if test="query.userId != null and query.userId !=''">
                 and t.id = #{query.userId}
             </if>
-            <if test='query.businessDeptId != null and query.businessDeptId != "" and query.businessDeptId!="0"'>
+            <if test='query.businessDeptId != null and query.businessDeptId != "" and query.businessDeptId!=0'>
                 and b.business_dept_id = #{query.businessDeptId}
             </if>
             <if test="query.billType != null">
@@ -350,9 +350,26 @@
         FROM
             t_street ts
                 LEFT JOIN t_house th ON ts.id = th.street_id
-                LEFT JOIN t_contract tc ON tc.house_id = th.id
-                LEFT JOIN t_bill tb ON tc.id = tb.contract_id
+                LEFT JOIN t_contract tc ON tc.house_id = th.id AND tc.pay_type = 2
+                LEFT JOIN t_bill tb ON tc.id = tb.contract_id AND tb.pay_fees_status != 5
+            <where>
+                <if test="businessDeptId != 0">
+                    AND th.business_dept_id = #{businessDeptId}
+                </if>
+            </where>
         GROUP BY ts.id
         ORDER BY rentAmount DESC
     </select>
+    <select id="getJiFuBillList" resultType="com.ruoyi.system.model.TBill" parameterType="java.lang.String">
+        SELECT tb.* FROM t_bill tb LEFT JOIN t_contract tt ON tb.contract_id = tt.id
+        <where>
+            tt.pay_type = 2 AND tb.bill_type = ${@com.ruoyi.common.enums.BillTypeEnum@Zujin.getCode()} AND tb.pay_fees_status != 5
+            <if test="businessDeptId != null and businessDeptId != 0">
+                AND tb.business_dept_id = #{businessDeptId}
+            </if>
+            <if test="first!=null and last !=null">
+                AND tb.payable_fees_time BETWEEN #{first} AND #{last}
+            </if>
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.7.1