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

---
 ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml b/ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml
index 0eefc41..d5450f9 100644
--- a/ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml
@@ -29,8 +29,16 @@
         id, house_picture, house_name, house_address, house_area, house_type, business_attributes, product_type, property_right_person, property_right_number, property_right_start_time, property_right_duration, lease_status, create_time, update_time, create_by, update_by, disabled
     </sql>
     <select id="houseList" resultType="com.ruoyi.system.model.THouse">
-        select t1.* from
-            t_house t1
+        select t1.*,t2.start_time as startTime
+        from t_house t1
+        left join t_contract t2
+        on (t2.house_id = t1.id
+        and t2.status != 1
+        and t2.status != 2
+        and t2.status != 3
+        and t2.status != 5
+        and t2.status != 8
+        and NOW() between t2.start_time and t2.end_time)
         <where>
             <if test="req.houseName != null and req.houseName != ''">
                 and t1.house_name like concat('%', #{req.houseName}, '%')
@@ -38,8 +46,14 @@
             <if test="req.propertyRightPerson != null and req.propertyRightPerson != ''">
                 and t1.property_right_person like concat('%', #{req.propertyRightPerson}, '%')
             </if>
-            <if test="req.leaseStatus != null">
+            <if test="req.leaseStatus == 3">
                 and t1.lease_status = #{req.leaseStatus}
+            </if>
+            <if test="req.leaseStatus == 2">
+                and (t2.start_time is not null)
+            </if>
+            <if test="req.leaseStatus == 1">
+                and (t2.start_time is null) and t1.lease_status = 1
             </if>
             AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
         </where>
@@ -56,6 +70,7 @@
             t3.room_number as roomNumber,
             t3.house_area as houseArea,
             t2.phone as loginAccount,
+            t2.tenant_type as tenantType,
             t2.id as tenantId,
             t2.id_card as idCard,
             t2.bank_number as bankNumber,

--
Gitblit v1.7.1