xuhy
2025-02-13 158210c9f5f06e3d763bf258f66fc5aacd924733
ruoyi-system/src/main/resources/mapper/system/TCheckAcceptRecordMapper.xml
@@ -28,7 +28,53 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, contract_id, house_id, check_time, lease_reason, check_person, accompany_person, overall_situation, furniture_situation, device_situation, clean_situation, other_problem, pictures, check_result, check_money, create_time, update_time, create_by, update_by, disabled
        id, contract_id, house_id, check_time, lease_reason, check_person, accompany_person, overall_situation, furniture_situation, device_situation, clean_situation,
            other_problem, pictures, check_result, check_money, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TCheckAcceptRecordVO">
        select
        t.id,
        t.contract_id,
        t.house_id,
        t.check_time,
        t.lease_reason,
        t.check_person,
        t.accompany_person,
        t.overall_situation,
        t.furniture_situation,
        t.device_situation,
        t.clean_situation,
        t.other_problem,
        t.pictures,
        t.check_result,
        t.check_money,
        t.create_time,
        t.update_time,
        t.create_by,
        t.update_by,
        t.disabled,
        c.contract_number,
        h.house_name
        from t_check_accept_record t
        left join t_contract c on t.contract_id = c.id
        left join t_house h on t.house_id = h.id
        <where>
            <if test="query.contractNumber != null and query.contractNumber != ''">
                AND c.contract_number LIKE concat('%', #{query.contractNumber}, '%')
            </if>
            <if test="query.checkResult != null">
                AND t.check_result = #{query.checkResult}
            </if>
            <if test="query.houseName != null and query.houseName != ''">
                AND h.house_name LIKE concat('%', #{query.houseName}, '%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND t.check_time &gt;= #{query.startTime}
                AND t.check_time &lt;= #{query.endTime}
            </if>
            AND t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY t.create_time DESC
    </select>
</mapper>