From 5437a89aca5c886290a4edb070211c0d3316abdd Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期四, 16 十一月 2023 16:41:20 +0800
Subject: [PATCH] 故障报修

---
 lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16(lnl)/sys_dict_update.sql         |    7 +++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EquipmentReportRepairServiceImpl.java |   11 +++--
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EquipmentReportRepairMapper.java            |    3 +
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml         |   44 +++++++++++++++++++++-
 4 files changed, 57 insertions(+), 8 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EquipmentReportRepairMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EquipmentReportRepairMapper.java
index 347649c..20b8620 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EquipmentReportRepairMapper.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EquipmentReportRepairMapper.java
@@ -6,6 +6,7 @@
 import org.jeecg.modules.eam.entity.ChangeCause;
 import org.jeecg.modules.eam.entity.EquipmentReportRepair;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -16,5 +17,5 @@
  */
 public interface EquipmentReportRepairMapper extends BaseMapper<EquipmentReportRepair> {
 
-    IPage<Map<String, Object>> getReportRepairList(IPage<Map> pageData, @Param("params") Map<String,Object> params);
+    IPage<Map<String, Object>> getReportRepairList(IPage<Map> pageData, @Param("params") Map<String,Object> params,@Param("equipNums") List<String> equipNums);
 }
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml
index 6ca6931..0a1d0b9 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml
@@ -5,6 +5,7 @@
         SELECT
             t1.id,
             t1.err_uda1 errUda1,
+            t1.err_uda2 errUda2,
             t1.num num,
             t1.equipment_id equipmentId,
             t1.fault_reason faultReason,
@@ -49,18 +50,57 @@
         <if test="params.equipmentId != null and params.equipmentId != ''">
             and t1.equipment_id = #{params.equipmentId}
         </if>
+        <if test="params.faultDescription != null and params.faultDescription != ''">
+            and t1.fault_description like concat('%',#{params.faultDescription},'%')
+        </if>
+        <if test="params.faultStartTime != null and params.faultStartTime != ''">
+            and t1.fault_time &gt;= #{params.faultStartTime}
+        </if>
+        <if test="params.faultEndTime != null and params.faultEndTime != ''">
+            and t1.fault_time &lt;= #{params.faultEndTime}
+        </if>
+        <if test="params.isStop != null and params.isStop != ''">
+            and t1.is_stop = #{params.isStop}
+        </if>
+        <if test="params.status != null and params.status != ''">
+            and t1.status = #{params.status}
+        </if>
+        <if test="params.errUda2 != null and params.errUda2 != ''">
+            and t1.err_uda2 like concat('%',#{params.errUda2},'%')
+        </if>
+        <if test="params.errUda1 != null and params.errUda1 != ''">
+            and t1.err_uda1 = #{params.errUda1}
+        </if>
+        <if test="params.isStop != null and params.isStop != ''">
+            and t1.is_stop  = #{params.isStop}
+        </if>
+        <if test="params.createBy!= null and params.createBy != ''">
+            and t1.create_by like concat('%',#{params.createBy},'%')
+        </if>
         <if test="params.equipmentNum != null and params.equipmentNum != ''">
             and t2.num like concat('%',#{params.equipmentNum},'%')
         </if>
         <if test="params.equipmentName != null and params.equipmentName != ''">
             and t2.name like concat('%',#{params.equipmentName},'%')
         </if>
-        <if test="params.status != null and params.status != ''">
-            and t1.status = #{params.status}
+        <if test="params.model != null and params.model != ''">
+            and t2.model like concat('%',#{params.model},'%')
+        </if>
+        <if test="params.specification != null and params.specification != ''">
+            and t2.specification like concat('%',#{params.specification},'%')
+        </if>
+        <if test="params.useId != null and params.useId != ''">
+            and t2.use_id  = #{params.useId}
         </if>
         <if test="params.teamId != null and params.teamId != ''">
             and t2.team_id = #{params.teamId}
         </if>
+        <if test="equipNums.size!=0">
+            and t2.num in
+            <foreach collection="equipNums" open="(" separator="," close=")" item="num">
+                #{num}
+            </foreach>
+        </if>
         ORDER BY t1.create_time desc
     </select>
 </mapper>
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EquipmentReportRepairServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EquipmentReportRepairServiceImpl.java
index 606c9bb..226a957 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EquipmentReportRepairServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EquipmentReportRepairServiceImpl.java
@@ -22,10 +22,7 @@
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: equipment_report_repair
@@ -105,6 +102,10 @@
             SysUser sysUser = userMapper.selectById((String)params.get("userId"));
             params.put("teamId",sysUser.getTeamId());
         }
-        return super.getBaseMapper().getReportRepairList(pageData, params) ;
+        List<String> equipNums = new ArrayList<>();
+        if(StringUtils.isNotBlank((String)params.get("nums"))){
+            equipNums = Arrays.asList(((String) params.get("nums")).trim().split(","));
+        }
+        return super.getBaseMapper().getReportRepairList(pageData, params,equipNums) ;
     }
 }
diff --git "a/lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16\050lnl\051/sys_dict_update.sql" "b/lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16\050lnl\051/sys_dict_update.sql"
new file mode 100644
index 0000000..c7c6eea
--- /dev/null
+++ "b/lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16\050lnl\051/sys_dict_update.sql"
@@ -0,0 +1,7 @@
+UPDATE [dbo].[sys_dict] SET [dict_name] = N'鏁呴殰鎶ヤ慨鐘舵��', [dict_code] = N'equipment_report_repair_status', [description] = '', [del_flag] = 0, [create_by] = N'admin', [create_time] = '2023-07-18 10:22:47.0000000', [update_by] = NULL, [update_time] = NULL, [type] = 0 WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127343392382977';
+UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'鎶ヤ慨', [item_value] = N'1', [description] = '', [sort_order] = 1, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:14.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:21:33.8620000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127454826651650';
+UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'缁翠慨', [item_value] = N'2', [description] = '', [sort_order] = 2, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:27.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:41.4540000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127509327437825';
+UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'澶т慨', [item_value] = N'3', [description] = '', [sort_order] = 3, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:36.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:54.6430000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127549194297346';
+UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'瀹屾垚', [item_value] = N'4', [description] = '', [sort_order] = 4, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:48.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:33.5730000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127599911821314';
+UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'楠屾敹', [item_value] = N'5', [description] = '', [sort_order] = 5, [status] = 1, [create_by] = N'admin', [create_time] = '2023-10-24 18:56:56.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 14:21:48.9800000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1716770747655516161';
+

--
Gitblit v1.9.3