xuhy
2025-02-13 158210c9f5f06e3d763bf258f66fc5aacd924733
ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml
@@ -34,7 +34,101 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, tenant_id, item_id,contract_id, fault_area_name, describe_name, describe_detail, fault_pictures, service_address, repair_type, visit_time, contact_number, leave_message, handle_person, handle_time, result_describe, repair_picture, attachment, status, create_time, update_time, create_by, update_by, disabled
        id, tenant_id, item_id,item_type_id,contract_id, fault_area_name, describe_name, describe_detail, fault_pictures, service_address, repair_type,
            visit_time, contact_number, leave_message, handle_person, handle_time, result_describe, repair_picture, attachment,attachment_name, status,
            create_time,update_time, create_by, update_by, disabled
    </sql>
    <select id="getDetailById" resultType="com.ruoyi.system.vo.TFaultRepairMessageVO">
        SELECT
        t.id,
        t.tenant_id,
        t.item_id,
        t.item_type_id,
        t.contract_id,
        t.fault_area_name,
        t.describe_name,
        t.describe_detail,
        t.fault_pictures,
        t.service_address,
        t.repair_type,
        t.visit_time,
        t.contact_number,
        t.leave_message,
        t.handle_person,
        t.handle_time,
        t.result_describe,
        t.repair_picture,
        t.attachment,
        t.attachment_name,
        t.status,
        t.create_time,
        t.update_time,
        t.create_by,
        t.update_by,
        t.disabled,
        i.item_name AS itemName,
        it.type_name AS itemTypeName,
        tnt.resident_name AS residentName
        from t_fault_repair_message t
        LEFT JOIN t_item i ON t.item_id = i.id
        LEFT JOIN t_item_type it ON t.item_type_id = it.id
        LEFT JOIN t_tenant tnt ON t.tenant_id = tnt.id
        WHERE t.id = #{id}
    </select>
    <select id="pageList" resultType="com.ruoyi.system.vo.TFaultRepairMessageVO">
        SELECT
            t.id,
            t.tenant_id,
            t.item_id,
            t.item_type_id,
            t.contract_id,
            t.fault_area_name,
            t.describe_name,
            t.describe_detail,
            t.fault_pictures,
            t.service_address,
            t.repair_type,
            t.visit_time,
            t.contact_number,
            t.leave_message,
            t.handle_person,
            t.handle_time,
            t.result_describe,
            t.repair_picture,
            t.attachment,
            t.attachment_name,
            t.status,
            t.create_time,
            t.update_time,
            t.create_by,
            t.update_by,
            t.disabled,
            i.item_name AS itemName,
            it.type_name AS itemTypeName,
            tnt.resident_name AS residentName
        from t_fault_repair_message t
                 LEFT JOIN t_item i ON t.item_id = i.id
                 LEFT JOIN t_item_type it ON t.item_type_id = it.id
                 LEFT JOIN t_tenant tnt ON t.tenant_id = tnt.id
        <where>
            <if test="query.tenantId != null and query.tenantId != ''">
                AND t.tenant_id = #{query.tenantId}
            </if>
            <if test="query.contactNumber != null and query.contactNumber != ''">
                AND t.contact_number LIKE CONCAT('%', #{query.contactNumber}, '%')
            </if>
            <if test="query.status != null">
                AND t.status = #{query.status}
            </if>
            <if test="query.repairType != null">
                AND t.repair_type = #{query.repairType}
            </if>
            <if test="query.handlePerson != null and query.handlePerson != ''">
                AND t.handle_person LIKE CONCAT('%', #{query.handlePerson}, '%')
            </if>
            AND t.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY t.create_time DESC
    </select>
</mapper>