From 665ffec07abac9fa14e7613fe1c73922a537ff77 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 06 五月 2025 16:00:19 +0800
Subject: [PATCH] art: 设备管理-看板接口-维修统计接口

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

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
index e95236a..cf05e8a 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
@@ -48,4 +48,23 @@
         </where>
         ORDER BY t1.create_time DESC
     </select>
+
+    <select id="equipmentRepairStatistics" resultType="org.jeecg.modules.eam.vo.EquipmentRepairStatistics">
+        select FORMAT(err.create_time, 'yyyy-MM') as monthStr,
+               COUNT(1) as reportNumber,
+               SUM(CASE WHEN err.report_status = 'COMPLETE' THEN 1 ELSE 0 END) as repairedNumber
+        from eam_report_repair err
+        inner join eam_equipment e
+        on err.equipment_id = e.id
+        where err.report_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.create_time &gt;= #{start}
+        and err.create_time &lt; #{end}
+        group by FORMAT(err.create_time, 'yyyy-MM')
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3