From d629434b0c626644dcbfbdef2d5f4006ed693a9a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期四, 16 十一月 2023 18:52:54 +0800
Subject: [PATCH] 维修完成12小时自动验收

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/RepairOrderMapper.xml |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/RepairOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/RepairOrderMapper.xml
index 1abdcd8..fd9b49c 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/RepairOrderMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/RepairOrderMapper.xml
@@ -15,6 +15,10 @@
         t2.name equipmentName,
         t2.model equipmentModel,
         t2.specific_equipment specificEquipment,
+        t1.fault_reason faultReason,
+        t1.fault_phenomenon faultPhenomenon,
+        t1.preventive_measure preventiveMeasure,
+        t1.fault_remove faultRemove,
         t1.fault_description faultDescription,
         t1.fault_time faultTime,
         t1.photo photo,
@@ -38,7 +42,7 @@
         t3.depart_name departName,
         t4.name outsourcingUnitName,
         t5.realname responsibilityName,
-        t6.`name` teamName
+        t6.name teamName
         from mom_eam_repair_order t1
         left join(select * from mom_eam_equipment where del_flag = 0 and status = 1) t2 on t1.equipment_id= t2.id
         left join sys_depart t3 on t3.id = t1.depart_id
@@ -49,6 +53,12 @@
         <if test="num != null and num != ''">
             and t1.num like concat('%',#{num},'%')
         </if>
+        <if test="equipNums.size!=0">
+            and t2.num in
+            <foreach collection="equipNums" open="(" separator="," close=")" item="num">
+                #{num}
+            </foreach>
+        </if>
         <if test="equipmentNum != null and equipmentNum != ''">
             and t2.num like concat('%',#{equipmentNum},'%')
         </if>
@@ -58,7 +68,20 @@
         <if test="status != null and status != ''">
             and t1.status = #{status}
         </if>
-        and t1.repair_order_type = #{repairOrderType} order by t1.create_time desc
+        <if test="equipmentCategoryId != null and equipmentCategoryId != ''">
+            and t2.equipment_category_id = #{equipmentCategoryId}
+        </if>
+        <if test="factoryModelId != null and factoryModelId != ''">
+            and t2.factory_model_id = #{factoryModelId}
+        </if>
+        <if test="specificEquipment != null and specificEquipment != ''">
+            and t2.specific_equipment = #{specificEquipment}
+        </if>
+        <if test="teamId != null and teamId != ''">
+            and t1.team_id = #{teamId}
+        </if>
+        and t1.repair_order_type = #{repairOrderType}
+        order by t1.create_time desc
     </select>
 
 
@@ -66,12 +89,12 @@
         select
         t1.realname as realName,
         t1.id,
-        t1.user_code as userCode,
-        t3.name as teamName,
-        t3.id as teamId
+        t1.username as userCode
+--         t3.name as teamName,
+--         t3.id as teamId
         FROM sys_user t1
-        LEFT JOIN mom_base_team_class t2 on t2.id =t1.team_class_id
-        LEFT JOIN mom_base_team t3 on t3.id =t2.team_id
+--         LEFT JOIN mom_base_team_class t2 on t2.id =t1.team_class_id
+--         LEFT JOIN mom_base_team t3 on t3.id =t2.team_id
         where t1.realname IS NOT NULL
         <if test="realname != null and realname != ''">
             and t1.realname like concat('%',#{realname},'%')
@@ -85,11 +108,11 @@
         select
         t1.id,
         t1.spare_part_id as sparePartId,
-        IFNULL(t1.use_quantity,0) as useQuantity,
+        ISNULL(t1.use_quantity,0) as useQuantity,
         t2.num,
         t2.id as outboundOrderId,
-        IFNULL(t1.outbound_main_quantity,0) as mainQuantity,
-        (IFNULL(t1.outbound_main_quantity,0)-IFNULL(t1.use_quantity,0)) as availableQuantity,
+        ISNULL(t1.outbound_main_quantity,0) as mainQuantity,
+        (ISNULL(t1.outbound_main_quantity,0)-ISNULL(t1.use_quantity,0)) as availableQuantity,
         t3.num as spareNum,
         t3.name as  spareName,
         t3.model,
@@ -103,7 +126,7 @@
         LEFT JOIN  mom_eam_spare_part   t3  on  t3.id =t1.spare_part_id
         LEFT JOIN  mom_base_constructor   t4  on  t4.id =t3.constructor_id
         LEFT JOIN  mom_base_unit   t5  on  t5.id =t1.main_unit_id
-        where t1.del_flag = 0 and t1.outbound_main_quantity != 0 and  (IFNULL(t1.outbound_main_quantity,0)-IFNULL(t1.use_quantity,0)) != 0
+        where t1.del_flag = 0 and t3.del_flag = 0 and t1.outbound_main_quantity != 0 and  (ISNULL(t1.outbound_main_quantity,0)-ISNULL(t1.use_quantity,0)) != 0
         <if test="status != null and status != ''">
             and t1.status = #{status}
         </if>

--
Gitblit v1.9.3