南昌市物联网技防平台-公安版
zengh
2021-06-07 ede5ed2555a02654ea8f722af20d76d61596564c
公安版本初版
1 files modified
18 ■■■■■ changed files
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml 18 ●●●●● patch | view | raw | blame | history
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -422,7 +422,6 @@
        where
        DATE_FORMAT(alarmTime,'%Y-%m-%d') >=#{beginTime}
        and DATE_FORMAT(alarmTime,'%Y-%m-%d') <=#{endTime}
        and a.waringType  IN("紧急求救")
        ORDER BY
        a.jtype ASC,
        a.alarmTime DESC
@@ -451,7 +450,7 @@
    <select id="selectAlarmCount" resultType="java.lang.Integer">
        SELECT count(*) FROM `sys_alarm`
        where
        waringType = '紧急求救'
        1=1
        <if test="conditionVo.status==0">
            and to_days(alarmTime) = to_days(curdate())
        </if>
@@ -482,7 +481,7 @@
        left join
        (
        select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm
            where waringType = '紧急求救'
            where 1=1
            group by DATE_FORMAT(alarmTime,'%Y-%m-%d')
        ) b
         on
@@ -514,7 +513,7 @@
    <!--查询本日,本周,本月 主动报警的数量-->
    <select id="selectAlarmSum" resultType="java.util.HashMap">
        select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm
        where waringType = '紧急求救'
        where 1=1
        <if test="conditionVo.status==0">
            and to_days(alarmTime) = to_days(now())
        </if>
@@ -665,7 +664,7 @@
    <select id="selAlarmTimeCount" resultType="java.lang.Integer">
        select count(*) from sys_alarm
        where waringType = '紧急求救'
        where 1=1
        <if test="conditionVo.startTime!=null and conditionVo.startTime!='' and conditionVo.endTime!=null and conditionVo.endTime!=''">
            and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
        </if>
@@ -674,7 +673,7 @@
    <!--查询当前时间段内一键求助报警的数据集合-->
    <select id="selectAlarmList" resultType="org.springblade.jfpt.alarm.entity.Alarm">
        SELECT waringType,alarmTime,alarmId,alarmPeople,jtype,czTime FROM `sys_alarm`
        where waringType='紧急求救'
        where 1=1
        and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
    </select>
@@ -691,7 +690,7 @@
        left join
        (
            select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm
            where waringType = '紧急求救'
            where 1=1
            group by DATE_FORMAT(alarmTime,'%Y-%m-%d')
        ) b
        on
@@ -714,7 +713,7 @@
                YEAR ( alarmTime ) = date_format(now(),'%Y%')
                AND MONTH ( alarmTime ) = #{item}
                AND waringType = "紧急求救"
                AND 1=1
                AND deviceNumber = #{deviceNumber}
            </foreach>
@@ -733,7 +732,6 @@
        LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber
        where 1=1
        <include refid="alarmCondition"></include>
        and a.waringType IN("紧急求救")
        ORDER BY
        a.jtype ASC,
        a.alarmTime DESC
@@ -742,7 +740,7 @@
    <!--获取实时警情图表统计数据-->
    <select id="getAlarmPie" resultType="org.springblade.common.entity.ReportReturnData">
        select if(1=1,"一键求助",0) type,ifnull(count(*),0) count from sys_alarm
        where waringType="紧急求救"
        where 1=1
        <include refid="alarmConditionPie"></include>
    </select>