From 5c18a8c93db1cf1b7b6d61a618e3a1b87fb14883 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 08 五月 2025 15:05:15 +0800
Subject: [PATCH] 看板接口mdc部分

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

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalInfoMapper.xml
index 2d4f020..24fa43b 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalInfoMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalInfoMapper.xml
@@ -26,4 +26,42 @@
         WHERE
             equipment_id = #{equipmentId} AND the_date LIKE CONCAT(#{date}, '%')
     </select>
+
+    <select id="findByEquipmentAndDate" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
+        SELECT
+            the_date,
+            AVG ( open_long ) openLong,
+            AVG ( wait_long ) waitLong,
+            AVG ( process_long ) processLong,
+            AVG ( close_long ) closeLong,
+            AVG ( error_long ) errorLong
+        FROM
+            mdc_equipment_statistical_info
+        <where>
+            the_date = #{date}
+            AND equipment_id IN
+            <foreach collection="equipmentList" index="index" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </where>
+        GROUP BY
+            the_date
+    </select>
+
+    <select id="findByEquIdAndDate" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
+        SELECT TOP 1 * FROM mdc_equipment_statistical_info WHERE equipment_id = #{equipmentId} AND the_date = #{date}
+    </select>
+
+    <select id="findByEquIdAndMonth" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
+        SELECT
+            AVG(open_long) openLong,
+            AVG(close_long) closeLong,
+            AVG(wait_long) waitLong,
+            AVG(process_long) processLong,
+            AVG(error_long) errorLong
+        FROM
+            mdc_equipment_statistical_info
+        WHERE
+            equipment_id = #{equipmentId} AND the_date LIKE CONCAT(#{month}, '%')
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3