| | |
| | | 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}, '%') |
| | |
| | | <if test="req.propertyRightPerson != null and req.propertyRightPerson != ''"> |
| | | and t1.property_right_person like concat('%', #{req.propertyRightPerson}, '%') |
| | | </if> |
| | | <if test="req.leaseStatus != null and req.houseName != ''"> |
| | | <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) |
| | | </if> |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by t1.create_time desc |