| | |
| | | for (Map<String, Object> beamMap : beamList) {
|
| | | String btime = beamMap.get("time").toString();
|
| | | if (btime.equals(rtime)) {
|
| | | realMap.put("beam", beamMap.get("beam").toString());
|
| | | realMap.put("beam", beamMap.get("beam").toString().split("\\.")[0]);
|
| | | }
|
| | | }
|
| | | Calendar calendar = Calendar.getInstance();
|
| | |
| | | for (Map<String, Object> map : resultList) {
|
| | | String date = map.get("time").toString().substring(0, 16);
|
| | | map.put("time", date);
|
| | | if (map.get("AQI") != null) {
|
| | | String aqi = map.get("AQI").toString().split("\\.")[0];
|
| | | map.put("AQI", aqi);
|
| | | }
|
| | | if (map.get("precip") != null) {
|
| | | String aqi = map.get("precip").toString();
|
| | | if (aqi.equals("0.0")) {
|
| | | map.put("precip", "");
|
| | | }
|
| | | }
|
| | | if (map.get("precip6") != null) {
|
| | | String aqi = map.get("precip6").toString();
|
| | | if (aqi.equals("0.0")) {
|
| | | map.put("precip6", "");
|
| | | }
|
| | | }
|
| | | }
|
| | | return resultList;
|
| | | }
|
| | |
| | | <select id="getBeamByMacs" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(h.time,'%Y-%m-%d %H:%i:%s') time, |
| | | round(avg(h.json->'$.e12[0]'),0) beam |
| | | avg(h.json->'$.e12[0]') beam |
| | | FROM history_hourly h |
| | | WHERE h.mac in |
| | | <foreach item="item" collection="macs" index="index" open="(" separator="," close=")">#{item}</foreach> |