| | |
| | | time |
| | | </select> |
| | | |
| | | <select id="getAreaAvgDataByAreaCode" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(time, #{typeFormat}) time, |
| | | AVG(aqi_json->'$.${sensors1}') AS '${sensors2}' |
| | | FROM |
| | | hangzhou_aqi ha |
| | | WHERE |
| | | ha.time >= #{start} |
| | | AND ha.time <![CDATA[<]]> #{end} |
| | | AND ha.city_code = #{areaCode} |
| | | GROUP BY |
| | | DATE_FORMAT(time, #{typeFormat}) |
| | | ORDER BY |
| | | time |
| | | </select> |
| | | |
| | | <select id="selectLineChartDateByCrieria" resultType="java.util.Map"> |
| | | SELECT |
| | | <choose> |
| | |
| | | DATE_FORMAT(time,'${@com.moral.common.util.ReportTimeFormat@toMySqlTimeFormat(timePeriod.timeUnits)}') as |
| | | format_time |
| | | FROM |
| | | `history_minutely` hmi |
| | | history_${timeUnits} hmi |
| | | <where> |
| | | and hmi.time >= #{timePeriod.startTime} |
| | | and hmi.time <![CDATA[<=]]> #{timePeriod.endTime} |