From 918827b48c6cc67cfd93994ef8809ec45d75a30f Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 14 十二月 2023 10:41:10 +0800
Subject: [PATCH] 报警分析二级列表

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

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
index a9566ea..70f146f 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
@@ -43,5 +43,123 @@
             start_time
     </select>
 
+    <!--璁$畻涓�娈垫椂闂村唴鐨勮繍琛屾暟鎹�-->
+    <select id="listEquipmentRunningSectionRun" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
+        SELECT
+            *
+        FROM
+            mdc_equipment_running_section
+        WHERE
+            equipment_id = #{ equipmentId }
+            AND status <![CDATA[ <> ]]> '22'
+            AND  (start_long &lt;= #{ endLong } AND end_long &gt;= #{ startLong })
+        ORDER BY
+            start_time
+    </select>
+
+    <!--璁$畻涓�娈垫椂闂村唴鐨勬晠闅滄暟鎹�-->
+    <select id="listEquipmentRunningSectionError" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
+        SELECT
+            *
+        FROM
+            mdc_equipment_running_section
+        WHERE
+            equipment_id = #{ equipmentId }
+            AND status = '22'
+            AND  (start_long &lt;= #{ endLong } AND end_long &gt;= #{ startLong })
+        ORDER BY
+            start_time
+    </select>
+
+    <!--鏌ヨ涓�娈垫椂闂村唴鐨勬姤璀︽暟鎹�-->
+    <select id="findAlarmList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
+        SELECT
+            *
+        FROM
+            mdc_equipment_running_section
+        <where>
+            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
+                AND equipment_id IN
+                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
+                    #{ id }
+                </foreach>
+            </if>
+            AND (start_time &lt;= #{ vo.endDate } AND end_time &gt;= #{ vo.startDate })
+            AND status = '22'
+            AND alarm != ''
+        </where>
+        ORDER BY
+            start_time
+    </select>
+
+    <!--鏌ヨ鏁伴噺-->
+    <select id="findAlarmCount" resultType="java.lang.Integer">
+        SELECT
+            COUNT(*)
+        FROM
+            mdc_equipment_running_section
+        <where>
+            AND status = '22'
+            AND alarm = #{ alarmCode }
+            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
+            AND equipment_id = #{ equipmentId }
+        </where>
+    </select>
+
+    <!--鏍规嵁鏃ユ湡鏌ヨ鏁伴噺-->
+    <select id="findAlarmCountByDate" resultType="java.lang.Integer">
+        SELECT
+            COUNT(*)
+        FROM
+            mdc_equipment_running_section
+        <where>
+            AND status = '22'
+            AND alarm = #{ vo.alarmCode }
+            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
+            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
+                AND equipment_id IN
+                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
+                    #{ id }
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <!--鏌ヨ鏃堕棿娈靛唴杩愯鏁版嵁-->
+    <select id="selectRunningData" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
+        SELECT
+            *
+        FROM
+            mdc_equipment_running_section
+        WHERE
+            equipment_id = #{ equipmentId }
+          AND status = '3'
+          AND  (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
+        ORDER BY
+            start_time
+    </select>
+
+    <!--鏌ヨ鎶ヨ鍙锋姤璀﹁缁嗕俊鎭�-->
+    <select id="selectAlarmList" resultType="org.jeecg.modules.mdc.dto.MdcAlarmListDto">
+        SELECT
+            t1.equipment_id,
+            t2.equipment_name,
+            t1.start_time,
+            t1.end_time,
+            t1.duration
+        FROM
+            mdc_equipment_running_section t1 LEFT JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id
+        <where>
+            AND t1.status = '22'
+            AND t1.alarm = #{ vo.alarmCode }
+            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
+                AND t1.equipment_id IN
+                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
+                    #{ id }
+                </foreach>
+            </if>
+        </where>
+    </select>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3