燕山石化溯源三维电子沙盘-【后端】-服务
6
13693261870
2023-07-29 4b4a150626f7943ee0811d7c3c718be0abe68b23
src/main/resources/mapper/QxshMapper.xml
@@ -19,6 +19,22 @@
        limit 10;
    </select>
    <select id="selectWarnByBeginAndEnd" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcyj from alert_config limit 1) and value &lt;= (select jcbj from alert_config limit 1)
        order by time desc, name;
    </select>
    <select id="selectAlarmByBeginAndEnd" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcbj from alert_config limit 1)
        order by time desc, name;
    </select>
    <select id="countMonthForWarn" resultType="java.lang.Integer">
        select count(*)
        from yssh_qxsh
@@ -29,7 +45,8 @@
    <select id="countMonthForAlarm" resultType="java.lang.Integer">
        select count(*)
        from yssh_qxsh
        where time between #{start} and #{end} and name like 'AI-%' and value > (select jcbj from alert_config limit 1);
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcbj from alert_config limit 1);
    </select>
    <select id="count7DayForWarn" resultType="java.util.Map">
@@ -46,12 +63,13 @@
        with rs as (
            select left(time, 8) "createTime"
            from yssh_qxsh
            where time between #{start} and #{end} and name like 'AI-%' and value > (select jcbj from alert_config limit 1)
            where time between #{start} and #{end} and name like 'AI-%'
                and value > (select jcbj from alert_config limit 1)
        )
        select createTime, count(*) "num" from rs group by createTime order by createTime;
    </select>
    <select id="selectByBeginAndEnd" resultType="com.yssh.entity.Qxsh">
    <select id="select3Hours" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        where time between #{start} and #{end}