无关风月
2025-01-21 97ea5e39da53fc6c36e3059857802022d89828f6
ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml
@@ -28,5 +28,39 @@
    <sql id="Base_Column_List">
        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
        <where>
            <if test="req.houseName != null and req.houseName != ''">
                and t1.house_name like concat('%', #{req.houseName}, '%')
            </if>
            <if test="req.propertyRightPerson != null and req.propertyRightPerson != ''">
                and t1.property_right_person like concat('%', #{req.propertyRightPerson}, '%')
            </if>
            <if test="req.leaseStatus != null">
                and t1.lease_status = #{req.leaseStatus}
            </if>
        </where>
    </select>
    <select id="userHistoryList" resultType="com.ruoyi.system.vo.HouseVO">
        select
            t2.resident_name as residentName,
            t2.phone as phone,
            t3.business_attributes as businessAttributes,
            t3.product_type as productType,
            t1.start_time as startTime,
            t3.building as building,
            t3.room_number as roomNumber,
            t3.house_area as houseArea,
            t2.phone as loginAccount,
            t2.id_card as idCard,
            t2.bank_number as bankNumber,
            t2.mail_address as mailAddress,
        from t_contract t1
        left join t_tenant t2 on t1.tenant_id = t2.id
        LEFT JOIN t_house t3 on t3.id = t1.house_id
        where t1.house_id = #{req.id}
    </select>
</mapper>