From 0f7973fafe2276f6646c23afaabf06fcaadaa892 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 13 二月 2025 13:57:22 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/xiaochen991015/xizang

---
 ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml |   96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml
index a7c6657..56ca1b4 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TFaultRepairMessageMapper.xml
+++ b/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>

--
Gitblit v1.7.1