南昌市物联网技防平台-后台
Administrator
2021-04-07 eb3440d7c0c7baef5e6fc888fd0076b1787643d9
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -253,6 +253,7 @@
    <select id="selectListSe" resultMap="alarmResultMap">
        SELECT
        a.id,
        a.alarmType,
@@ -331,6 +332,25 @@
       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 ) &lt; 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>
<!--    &lt;!&ndash;查询本日,本周,本月 主动报警的数量&ndash;&gt;-->
<!--    <select id="selectAlarmSum" resultType="java.util.HashMap">-->
@@ -434,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>