From 915a2e40175c6390802af1257e57effea5fd02ef Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 06 五月 2025 17:35:32 +0800
Subject: [PATCH] art: 设备管理-看板接口-点检、周保统计接口

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

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamInspectionOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamInspectionOrderMapper.xml
index b596292..225c243 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamInspectionOrderMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamInspectionOrderMapper.xml
@@ -9,4 +9,24 @@
         on wmo.equipment_id = e.id
         ${ew.customSqlSegment}
     </select>
+
+    <select id="equipmentInspectionStatistics"
+            resultType="org.jeecg.modules.eam.vo.EquipmentInspectionStatistics">
+        select FORMAT(err.inspection_date, 'yyyy-MM') as monthStr,
+        COUNT(1) as planNumber,
+        SUM(CASE WHEN err.inspection_status = 'COMPLETE' THEN 1 ELSE 0 END) as completeNumber
+        from eam_inspection_order err
+        inner join eam_equipment e
+        on err.equipment_id = e.id
+        where err.inspection_status != 'ABOLISH' and err.del_flag = 0 and e.del_flag = 0
+        <if test="productionIds != null">
+            AND e.org_id IN
+            <foreach collection="productionIds" item="productionId" index="index" open="(" close=")" separator=",">
+                #{productionId}
+            </foreach>
+        </if>
+        and err.inspection_date &gt;= #{start}
+        and err.inspection_date &lt; #{end}
+        group by FORMAT(err.inspection_date, 'yyyy-MM')
+    </select>
 </mapper>

--
Gitblit v1.9.3