From 2be9b7f9c675e6ffe64adfac0a3e37f30404af99 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期三, 11 六月 2025 10:35:58 +0800
Subject: [PATCH] 工具管理-刀具准备单功能接口开发

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
index dfbd659..dd2d260 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
@@ -8,13 +8,13 @@
             t2.equipment_name
         FROM
             eam_report_repair t1
-                LEFT JOIN eam_equipment t2 ON t1.equipment_id = t2.equipment_code
+                LEFT JOIN eam_equipment t2 ON t1.equipment_id = t2.id
         <where>
             <choose>
                 <when test="equipmentIds != null and equipmentIds.size() > 0 ">
-                    AND t1.equipment_id IN
+                    AND t2.equipment_code IN
                     <foreach collection="equipmentIds" item="equipmentId" index="index" open="(" close=")" separator=",">
-                        {equipmentId}
+                        #{equipmentId}
                     </foreach>
                 </when>
                 <otherwise>
@@ -22,7 +22,10 @@
                 </otherwise>
             </choose>
             <if test="eamReportRepair.equipmentId != null and eamReportRepair.equipmentId != ''">
-                AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{ eamReportRepair.equipmentId }),'%')
+                AND t2.id = #{ eamReportRepair.equipmentId }
+            </if>
+            <if test="eamReportRepair.equipmentCode != null and eamReportRepair.equipmentCode != ''">
+                AND t2.equipment_code LIKE CONCAT(CONCAT('%',#{ eamReportRepair.equipmentCode }),'%')
             </if>
             <if test="eamReportRepair.equipmentName != null and eamReportRepair.equipmentName != ''">
                 AND t2.equipment_name = LIKE CONCAT(CONCAT('%',#{ eamReportRepair.equipmentName }),'%')
@@ -43,6 +46,13 @@
                 AND t1.fault_start_time BETWEEN #{ eamReportRepair.startTime } AND #{ eamReportRepair.endTime }
             </if>
         </where>
-        ORDER BY t1.fault_start_time DESC
+        ORDER BY t1.create_time DESC
+    </select>
+    <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamReportRepair">
+        select wmo.*, e.equipment_code, e.equipment_name, e.installation_position
+        from eam_report_repair wmo
+        inner join eam_equipment e
+        on wmo.equipment_id = e.id
+        ${ew.customSqlSegment}
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3