From da124bc60214876ec2b00d00d865b14cf9bb9535 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 12 二月 2025 09:48:31 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/xiaochen991015/xizang

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

diff --git a/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
index 2f8fbd8..8ac1c4a 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -42,6 +42,37 @@
             h.house_name as houseName
         FROM
             t_bill b
+        LEFT JOIN t_contract c ON c.contract_number = b.contract_number and c.disabled=0
+        LEFT JOIN t_house h ON h.id = c.house_id and h.disabled=0
+        LEFT JOIN t_tenant t ON t.id = c.tenant_id and t.disabled=0
+        <where>
+            b.disabled=0
+            <if test="query.payFeesStatus != null">
+                and b.pay_fees_status = #{query.payFeesStatus}
+            </if>
+            <if test="query.phone != null and query.phone !=''">
+                and t.phone = #{query.phone}
+            </if>
+            <if test="query.residentName != null and query.residentName !=''">
+                and t.resident_name like concat('%',#{query.residentName},'%')
+            </if>
+            <if test="query.contractNumber != null and query.contractNumber !=''">
+                and b.contract_number = #{query.contractNumber}
+            </if>
+            <if test="query.userId != null and query.userId !=''">
+                and t.id = #{query.userId}
+            </if>
+        </where>
+    </select>
+    <select id="getBillList" resultType="com.ruoyi.system.dto.TBillDto">
+        SELECT
+        b.*,
+        t.resident_name as residentName,
+        t.phone,
+        t.account,
+        h.house_name as houseName
+        FROM
+        t_bill b
         LEFT JOIN t_contract c ON c.contract_number = b.contract_number
         LEFT JOIN t_house h ON h.id = c.house_id
         LEFT JOIN t_tenant t ON t.id = c.tenant_id
@@ -63,4 +94,36 @@
             </if>
         </where>
     </select>
+    <select id="invoiceList" resultType="com.ruoyi.system.dto.TBillDto">
+        SELECT
+        b.*,
+        t.resident_name as residentName,
+        t.phone,
+        t.account,
+        h.house_name as houseName
+        FROM
+        t_bill b
+        LEFT JOIN t_contract c ON c.contract_number = b.contract_number
+        LEFT JOIN t_house h ON h.id = c.house_id
+        LEFT JOIN t_tenant t ON t.id = c.tenant_id
+        LEFT JOIN t_invoice_to_bill tb ON b.id = tb.bill_id
+        <where>
+            <if test="query.payFeesStatus != null">
+                and b.pay_fees_status = #{query.payFeesStatus}
+            </if>
+            <if test="query.phone != null and query.phone !=''">
+                and t.phone = #{query.phone}
+            </if>
+            <if test="query.residentName != null and query.residentName !=''">
+                and t.resident_name like concat('%',#{query.residentName},'%')
+            </if>
+            <if test="query.contractNumber != null and query.contractNumber !=''">
+                and b.contract_number = #{query.contractNumber}
+            </if>
+            <if test="query.userId != null and query.userId !=''">
+                and t.id = #{query.userId}
+            </if>
+            and tb.invoice_id IS NULL
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.7.1