| | |
| | | with rs as ( |
| | | select id, name, lon, lat, format(value, 2) "value", time |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | where time between '${start}' and '${end}' and name like 'AI-%' |
| | | ) |
| | | select id, name, lon, lat, value, time from rs |
| | | order by value desc |
| | |
| | | <select id="selectWarnByBeginAndEnd" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, lon, lat, format(value, 2) "value", time |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | where time between '${start}' and '${end}' and name like 'AI-%' |
| | | and value > (select jcyj from alert_config limit 1) and value <= (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_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | 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> |
| | |
| | | with rs as (select jcyj, jcbj from alert_config limit 1) |
| | | select count(id) |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | where time between '${start}' and '${end}' and name like 'AI-%' |
| | | and value > (select jcyj from rs) and value <= (select jcbj from rs); |
| | | </select> |
| | | |
| | | <select id="countMonthForAlarm" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | where time between '${start}' and '${end}' and name like 'AI-%' |
| | | and value > (select jcbj from alert_config limit 1); |
| | | </select> |
| | | |
| | |
| | | with rs as ( |
| | | select left(time, 8) "createTime" |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | where time between '${start}' and '${end}' and name like 'AI-%' |
| | | and value > (select jcyj from alert_config limit 1) and value <= (select jcbj from alert_config limit 1) |
| | | ) |
| | | select createTime, count(*) "num" from rs group by createTime order by createTime; |
| | |
| | | with rs as ( |
| | | select left(time, 8) "createTime" |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} and name like 'AI-%' |
| | | 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 id="select3Hours" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, lon, lat, format(value, 2) "value", time |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} |
| | | where time between '${start}' and '${end}' |
| | | and value > (select jcyj from alert_config limit 1) and name like 'AI-%' |
| | | order by time, name; |
| | | </select> |
| | |
| | | <select id="selectForReport" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, format(value, 2) "value", time |
| | | from yssh_gcsj |
| | | where time between #{start} and #{end} |
| | | where time between '${start}' and '${end}' |
| | | and value > (select jcbj from alert_config limit 1) and name like 'AI-%' |
| | | order by time, name; |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="countGcsjByTime" resultType="java.lang.Integer"> |
| | | select count(id) from yssh_gcsj where time between #{start} and #{end}; |
| | | select count(id) from yssh_gcsj where time between '${start}' and '${end}'; |
| | | </select> |
| | | |
| | | <select id="countQxshByTime" resultType="java.lang.Integer"> |