From b2be113822cad796a1489b7fc52de2cb4042b57c Mon Sep 17 00:00:00 2001
From: zhangmei <645025773@qq.com>
Date: 星期二, 18 二月 2025 12:54:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xizang-changyun' into xizang-changyun

---
 ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml |   17 +++++++++++++++++
 1 files changed, 17 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 c52d5ba..76763fd 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -63,6 +63,7 @@
                 and t.id = #{query.userId}
             </if>
         </where>
+        order by b.payable_fees_time desc
     </select>
     <select id="getBillList" resultType="com.ruoyi.system.dto.TBillDto">
         SELECT
@@ -128,4 +129,20 @@
         </where>
         order by b.pay_fees_time
     </select>
+
+    <select id="selectTenentByBillId" resultType="com.ruoyi.system.dto.TBillDto">
+        SELECT
+            b.*,
+            t.resident_name as residentName,
+            t.email,
+            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 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.id = #{billId}
+    </select>
 </mapper>

--
Gitblit v1.7.1