From 6a3591c42a84b36d24d75f4584f0eeb145bb4de7 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期五, 15 三月 2024 15:00:24 +0800
Subject: [PATCH] xg

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

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
index f0175f1..6f7d0c0 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
@@ -8,6 +8,8 @@
             t1.num,
             t1.inspection_time as inspectionDate,
             t1.inspection_time as inspectionTime,
+            DATEADD(DAY,+7,t1.inspection_time)   as redWarningTime,
+            CONVERT(varchar(100), GETDATE(), 20) AS currentDateTime,
             t1.inspection_deadline as inspectionDeadline,
             t1.start_work_condition as startWorkCondition,
             t1.status,
@@ -20,23 +22,22 @@
             t2.team_id as teamId,
             t2.use_id as useId,
             t3.id as inspectionCycleId,
-            concat(t3.code, '/', t3.name) as inspectionCycleName,
+            t3.name as inspectionCycleName,
             t3.effective_time as effectiveTime,
             t3.unit as unit,
             t4.id as inspectionStandardId,
             t4.num as inspectionStandardNum,
             t1.create_by as createBy,
             t1.create_time as createTime,
-            t2.use_id as useId,
             t6.depart_name as useDepartName,
-            t2.team_id as teamId,
             t7.name as teamName,
             t4.assign_mode as assignMode,
             t8.item_text as assignModeName,
-            t1.inspection_user_id as inspectionUserId,
-            t9.realname as inspectionUserName,
+            t1.inspection_order_uda2 as inspectionUserName,
             t1.actual_end_time as actualEndTime,
-            t1.actual_start_time as actualStartTime
+            t1.actual_start_time as actualStartTime,
+            t1.inspection_order_uda1 AS repairConfirmPerson,
+            t1.repair_confirm_date as repairConfirmDate
         FROM
             mom_eam_inspection_order t1
         LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id
@@ -46,7 +47,6 @@
         left join sys_depart t6 on t2.use_id = t6.id
         left join mom_base_team t7 on t2.team_id = t7.id
         left join ( SELECT * FROM v_sys_dict WHERE dict_code = 'assign_mode' ) t8 on t8.item_value = t4.assign_mode
-        left join sys_user t9 on t1.inspection_user_id = t9.id
         WHERE t1.del_flag = 0 and t2.del_flag = 0 and t3.del_flag = 0 and t4.del_flag = 0
 <!--        <if test="params.dailyInspectionStandardId != null and params.dailyInspectionStandardId != ''">-->
 <!--            and t1.daily_inspection_standard_id = #{params.dailyInspectionStandardId}-->
@@ -54,14 +54,32 @@
         <if test="params.num != null and params.num != ''">
             and t1.num like concat('%',#{params.num},'%')
         </if>
+        <if test="params.equipmentNum != null and params.equipmentNum != ''">
+            and t2.num like concat('%',#{params.equipmentNum},'%')
+        </if>
+        <if test="params.useDepartId != null and params.useDepartId != ''">
+            and t2.use_id = #{params.useDepartId}
+        </if>
+        <if test="params.status != null and params.status != ''">
+            and t1.status = #{params.status}
+        </if>
+        <if test="params.teamId != null and params.teamId != ''">
+            and t2.team_id = #{params.teamId}
+        </if>
+        <if test="params.inspectionStartTime != null">
+            and t1.actual_end_time &gt;= #{params.inspectionStartTime}
+        </if>
+        <if test="params.inspectionEndTime != null">
+            and t1.actual_end_time &lt;= #{params.inspectionEndTime}
+        </if>
         ORDER BY t1.create_time desc
     </select>
 
     <select id="getInspectionCycleByEqId"  parameterType="Map" resultType="org.jeecg.modules.eam.model.InspectionCycleVo">
         SELECT DISTINCT
             t1.inspection_cycle_id AS value,
-            concat(t3.code, '/', t3.name) as text,
-            concat(t3.code, '/', t3.name) as title
+            t3.name as text,
+            t3.name as title
         FROM
             mom_eam_daily_inspection_standard_detail t1
         LEFT JOIN mom_eam_daily_inspection_standard t2 ON t1.daily_inspection_standard_id = t2.id
@@ -83,6 +101,7 @@
             t1.photo,
             t1.inspection_project_id as inspectionProjectId,
             t3.num as inspectionProjectNum,
+            t3.name as inspectionProjectName,
             t3.detection_standard as detectionStandard,
             t3.acceptability_limit AS acceptabilityLimit,
             t3.inspection_method as inspectionMethod,
@@ -113,6 +132,7 @@
             t1.photo,
             t1.inspection_project_id AS inspectionProjectId,
             t3.num AS inspectionProjectNum,
+            t3.name as inspectionProjectName,
             t3.detection_standard AS detectionStandard,
             t3.acceptability_limit AS acceptabilityLimit,
             t3.inspection_method AS inspectionMethod,
@@ -132,20 +152,36 @@
         </if>
     </select>
 
+<!--    <select id="findUserList"  parameterType="Map" resultType="Map">-->
+<!--        SELECT-->
+<!--            t1.id,-->
+<!--            t1.username,-->
+<!--            t1.realname,-->
+<!--            t3.name as teamName-->
+<!--        FROM-->
+<!--            sys_user t1-->
+<!--        LEFT JOIN mom_base_team_class t2 ON t1.team_class_id = t2.id-->
+<!--        left join mom_base_team t3 on t2.team_id = t3.id-->
+<!--        where t1.del_flag = 0 and t2.del_flag = 0 and t3.id = #{params.teamId}-->
+<!--        <if test="params.num!=null and params.num!= ''">-->
+<!--            and t3.num like concat('%',#{params.num},'%')-->
+<!--        </if>-->
+<!--        <if test="params.username!=null and params.username!= ''">-->
+<!--            and t1.username like concat('%',#{params.username},'%')-->
+<!--        </if>-->
+<!--        <if test="params.realname!=null and params.realname!= ''">-->
+<!--            and t1.realname like concat('%',#{params.realname},'%')-->
+<!--        </if>-->
+<!--        ORDER BY t1.create_time desc-->
+<!--    </select>-->
     <select id="findUserList"  parameterType="Map" resultType="Map">
         SELECT
-            t1.id,
-            t1.username,
-            t1.realname,
-            t3.name as teamName
+        t1.id,
+        t1.username,
+        t1.realname
         FROM
-            sys_user t1
-        LEFT JOIN mom_base_team_class t2 ON t1.team_class_id = t2.id
-        left join mom_base_team t3 on t2.team_id = t3.id
-        where t1.del_flag = 0 and t2.del_flag = 0 and t3.id = #{params.teamId}
-        <if test="params.num!=null and params.num!= ''">
-            and t3.num like concat('%',#{params.num},'%')
-        </if>
+        sys_user t1
+        where t1.del_flag = 0
         <if test="params.username!=null and params.username!= ''">
             and t1.username like concat('%',#{params.username},'%')
         </if>

--
Gitblit v1.9.3