燕山石化溯源三维电子沙盘-【后端】-服务
4
13693261870
2023-07-29 450688a18ced81ec1bd77a535492b12548249e69
src/main/resources/mapper/QxshMapper.xml
@@ -19,12 +19,23 @@
        limit 10;
    </select>
    <select id="count7DayForWarn" resultType="com.yssh.entity.Qxsh">
        select id, name, format(value, 2) "value", time
        from yssh_qxsh
        where time between #{start} and #{end}
            and value > (select jcyj from alert_config limit 1) and name like 'AI-%'
        order by time, name;
    <select id="count7DayForWarn" resultType="java.util.Map">
        with rs as (
            select left(time, 8) "createTime"
            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)
        )
        select createTime, count(*) "num" from rs group by createTime order by createTime;
    </select>
    <select id="count7DayForAlarm" resultType="java.util.Map">
        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)
        )
        select createTime, count(*) "num" from rs group by createTime order by createTime;
    </select>
    <select id="selectByBeginAndEnd" resultType="com.yssh.entity.Qxsh">