From eb3440d7c0c7baef5e6fc888fd0076b1787643d9 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 07 Apr 2021 16:14:18 +0800
Subject: [PATCH] 预警时间分布接口新增
---
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
index 64fe725..7d50353 100644
--- a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -32,13 +32,14 @@
<result column="name" property="name"/>
<result column="cid" property="cid"/>
<result column="vaddress" property="vaddress"/>
+ <result column="aaddress" property="aaddress"/>
</resultMap>
<select id="selectAlarmPage" resultMap="alarmResultMap">
select
a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType,a.bz,
- a.deviceNumber,a.region,a.district,a.vaddress,
+ a.deviceNumber,a.region,a.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,a.province,a.city,a.cid,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone,
e.stype,
@@ -252,6 +253,7 @@
<select id="selectListSe" resultMap="alarmResultMap">
+
SELECT
a.id,
a.alarmType,
@@ -327,8 +329,28 @@
) b
on
a.click_date = b.datetime
+ order by a.click_date asc
</select>
+ <!--查询警情当前时间段内每天的数据-->
+ <select id="selectTimeAlarmData" resultType="java.lang.Integer">
+ select a.days, ifnull(count,0) count from
+ (
+ SELECT @date := DATE_ADD( @date, INTERVAL + 1 DAY ) days FROM
+ (
+ SELECT @date := DATE_ADD( #{conditionVo.startTime}, INTERVAL - 1 DAY ) FROM sys_date
+ ) time
+ WHERE to_days( @date ) < to_days( #{conditionVo.endTime} )
+ ) a
+ left join
+ (
+ select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm
+ where waringType = '紧急求救'
+ group by DATE_FORMAT(alarmTime,'%Y-%m-%d')
+ ) b
+ on
+ a.days = b.datetime
+ </select>
<!-- <!–查询本日,本周,本月 主动报警的数量–>-->
<!-- <select id="selectAlarmSum" resultType="java.util.HashMap">-->
@@ -432,4 +454,24 @@
<update id="updateVaddress">
update sys_alarm SET vaddress=#{vaddress} where id=#{jid}
</update>
+
+
+ <select id="selectEq" resultType="java.util.HashMap">
+ SELECT COUNT(deviceNumber) as cou,deviceNumber FROM `sys_alarm` WHERE alarmTime like concat(concat('%', #{time}), '%') and waringType NOT IN("系统测试","主机重新上电") group by deviceNumber
+ </select>
+
+ <select id="selAlarmTimeCount" resultType="java.lang.Integer">
+ select count(*) from sys_alarm
+ where waringType = '紧急求救'
+ <if test="conditionVo.startTime!=null and conditionVo.startTime!='' and conditionVo.endTime!=null and conditionVo.endTime!=''">
+ and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
+ </if>
+ </select>
+
+ <!--查询当前时间段内一键求助报警的数据集合-->
+ <select id="selectAlarmList" resultType="org.springblade.jfpt.alarm.entity.Alarm">
+ SELECT waringType,alarmTime,alarmId,alarmPeople,jtype,czTime FROM `sys_alarm`
+ where waringType='紧急求救'
+ and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
+ </select>
</mapper>
--
Gitblit v1.9.3