From db1a8cd3c7d8423f39bb2bf47bc908d78e3db622 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 14 十一月 2023 16:00:00 +0800
Subject: [PATCH] 添加时间筛选条件
---
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml | 95 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 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 8d0ef8f..003fed6 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
@@ -30,5 +30,100 @@
start_time
</select>
+ <!--璁$畻涓�娈垫椂闂村唴鐨勬暟鎹�-->
+ <select id="listEquipmentRunningSection" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
+ SELECT
+ *
+ FROM
+ mdc_equipment_running_section
+ WHERE
+ equipment_id = #{ equipmentId }
+ AND (start_long <= #{ endLong } AND end_long >= #{ startLong })
+ ORDER BY
+ 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 <= #{ endLong } AND end_long >= #{ 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 <= #{ endLong } AND end_long >= #{ 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 <= #{ vo.endDate } AND end_time >= #{ 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 <= #{ endDate } AND end_time >= #{ 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 <= #{ endDate } AND end_time >= #{ 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>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3