南昌市物联网技防平台-后台
zengh
2021-11-04 57c72c8438ccb461d5d2f751f710d6908f0e0d32
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -243,38 +243,44 @@
        SELECT
        *
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
            <if test="alarm.district!=null">
                and district like concat('%',#{alarm.district},'%')
            </if>
            <if test="alarm.province!=null">
                and province like concat('%',#{alarm.province},'%')
            </if>
            <if test="alarm.city!=null">
                and city like concat('%',#{alarm.city},'%')
            </if>
            <if test="alarm.alarmPeople!=null">
                and alarmPeople like concat('%',#{alarm.alarmPeople},'%')
            </if>
            <if test="alarm.jtype!=null">
                and jtype = #{alarm.jtype}
            </if>
            AND waringType IN ( "安装任务" )
        1 = 1
        <if test="alarm.district!=null">
            and district like concat('%',#{alarm.district},'%')
        </if>
        <if test="alarm.province!=null">
            and province like concat('%',#{alarm.province},'%')
        </if>
        <if test="alarm.city!=null">
            and city like concat('%',#{alarm.city},'%')
        </if>
        <if test="alarm.alarmPeople!=null">
            and alarmPeople like concat('%',#{alarm.alarmPeople},'%')
        </if>
        <if test="alarm.jtype!=null">
            and jtype = #{alarm.jtype}
        </if>
        <if test="alarm.rname!=null">
            and rname like concat('%',#{alarm.rname},'%')
        </if>
        <if test="alarm.deviceNumber!=null">
            and deviceNumber like concat('%',#{alarm.deviceNumber},'%')
        </if>
        AND waringType IN ( "安装任务" )
        ORDER BY
            jtype ASC,
            alarmTime DESC
        jtype ASC,
        alarmTime DESC
    </select>
    <select id="getChartData" resultType="java.util.Map">
        SELECT
            COUNT( * ) AS value,
            "未安装" as name
        COUNT( * ) AS value,
        "未安装" as name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -283,15 +289,15 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND jtype = 0
            AND waringType IN ( "安装任务" ) UNION ALL
        AND jtype = 0
        AND waringType IN ( "安装任务" ) UNION ALL
        SELECT
            COUNT( * ) AS value,
            "已安装" as name
        COUNT( * ) AS value,
        "已安装" as name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -300,19 +306,19 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND jtype = 2
            AND waringType IN ( "安装任务" )
        AND jtype = 2
        AND waringType IN ( "安装任务" )
    </select>
    <select id="getChartDataAlarm" resultType="java.util.Map">
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "未处理" AS name
        ,
        "未处理" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -321,17 +327,17 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND jtype = 0
            AND waringType IN ( "紧急求救" ) UNION ALL
        AND jtype = 0
        AND waringType IN ( "紧急求救" ) UNION ALL
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "处理中" AS name
        ,
        "处理中" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -340,18 +346,18 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND jtype = 1
            AND waringType IN ( "紧急求救" )
            UNION ALL
        AND jtype = 1
        AND waringType IN ( "紧急求救" )
        UNION ALL
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "已处理" AS name
        ,
        "已处理" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -360,19 +366,19 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND jtype = 2
            AND waringType IN ( "紧急求救" )
        AND jtype = 2
        AND waringType IN ( "紧急求救" )
    </select>
    <select id="getChartDataAlarmBs" resultType="java.util.Map">
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "一般警情" AS name
        ,
        "一般警情" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -381,17 +387,17 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND alarmbs = 0
            AND waringType IN ( "紧急求救" ) UNION ALL
        AND alarmbs = 0
        AND waringType IN ( "紧急求救" ) UNION ALL
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "误报警情" AS name
        ,
        "误报警情" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -400,18 +406,18 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND alarmbs = 1
            AND waringType IN ( "紧急求救" )
            UNION ALL
        AND alarmbs = 1
        AND waringType IN ( "紧急求救" )
        UNION ALL
        SELECT
            COUNT( * ) AS
        COUNT( * ) AS
        value
            ,
            "严重警情" AS name
        ,
        "严重警情" AS name
        FROM
            sys_alarm
        sys_alarm
        WHERE
            1 = 1
        1 = 1
        <if test="beginTime!=null and beginTime!=''">
            and alarmTime&gt;=#{beginTime}
@@ -420,8 +426,8 @@
            and alarmTime&lt;=#{endTime}
        </if>
            AND alarmbs = 2
            AND waringType IN ( "紧急求救" )
        AND alarmbs = 2
        AND waringType IN ( "紧急求救" )
    </select>
    <select id="listAll" resultMap="alarmResultMap">