From ed48aa9f30a87c528f071d06bf6b59d7d15428e9 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期一, 26 五月 2025 16:12:55 +0800
Subject: [PATCH] 点检报表后端

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
index 4f47d99..cd5b126 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -58,6 +58,9 @@
         WHERE
             med.equipment_id = me.id
             AND med.dep_id = #{ departId }
+            <if test="key != null and key != '' ">
+                AND me.device_abnormal_status = 1
+            </if>
         ORDER BY me.equipment_id
     </select>
 
@@ -71,6 +74,9 @@
         WHERE
             mpe.equipment_id = me.id
             AND mpe.production_id = #{ productionId }
+          <if test="key != null and key != '' ">
+              AND me.device_abnormal_status = 1
+          </if>
         ORDER BY me.equipment_id
     </select>
 
@@ -83,9 +89,9 @@
             LEFT JOIN mdc_production_equipment mpe ON me.id = mpe.equipment_id
         WHERE
             mpe.production_id IN
-        <foreach collection="allProductionIds" index="index" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>
+            <foreach collection="allProductionIds" index="index" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
     </select>
 
     <!--鏌ヨ璁惧鐩戞帶淇℃伅-->
@@ -143,6 +149,7 @@
             <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                 #{id}
             </foreach>
+            AND me.device_abnormal_status = 1
         </where>
         ORDER BY sd.depart_order
     </select>
@@ -167,6 +174,7 @@
             <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                 #{id}
             </foreach>
+            AND me.device_abnormal_status = 1
         </where>
         ORDER BY mp.production_order
     </select>
@@ -217,6 +225,12 @@
             <if test="mdcEquipment.deviceCategory != null and mdcEquipment.deviceCategory != '' ">
                 AND t1.device_category = #{mdcEquipment.deviceCategory}
             </if>
+            <if test="mdcEquipment.deviceImportanceLevel != null and mdcEquipment.deviceImportanceLevel != '' ">
+                AND t1.device_importance_level = #{mdcEquipment.deviceImportanceLevel}
+            </if>
+            <if test="mdcEquipment.deviceAbnormalStatus != null and mdcEquipment.deviceAbnormalStatus != '' ">
+                AND t1.device_abnormal_status = #{mdcEquipment.deviceAbnormalStatus}
+            </if>
             <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 ">
                 AND t3.id IN
                 <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")">
@@ -250,6 +264,18 @@
             <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' ">
                 AND t1.drive_type = #{mdcEquipment.driveType}
             </if>
+            <if test="mdcEquipment.deviceLevel != null and mdcEquipment.deviceLevel != '' ">
+                AND t1.device_level = #{mdcEquipment.deviceLevel}
+            </if>
+            <if test="mdcEquipment.deviceCategory != null and mdcEquipment.deviceCategory != '' ">
+                AND t1.device_category = #{mdcEquipment.deviceCategory}
+            </if>
+            <if test="mdcEquipment.deviceImportanceLevel != null and mdcEquipment.deviceImportanceLevel != '' ">
+                AND t1.device_importance_level = #{mdcEquipment.deviceImportanceLevel}
+            </if>
+            <if test="mdcEquipment.deviceAbnormalStatus != null and mdcEquipment.deviceAbnormalStatus != '' ">
+                AND t1.device_abnormal_status = #{mdcEquipment.deviceAbnormalStatus}
+            </if>
             <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 ">
                 AND t3.id IN
                 <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")">

--
Gitblit v1.9.3