| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getAreaAvgDataByAreaCode(Map<String, Object> parameters) throws Exception { |
| | | convertQueryParam(parameters); |
| | | if (!ObjectUtils.isEmpty(parameters.get("compensate"))) { |
| | | parameters.put("timeUnits", "10min"); |
| | | } |
| | | return historyMinutelyMapper.getAreaAvgDataByAreaCode(parameters); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void convertQueryParam(Map<String, Object> parameters) throws ParseException { |
| | | if (!parameters.containsKey("field")) { |
| | | // String type = (String) parameters.get("type"); |
| | |
| | | String[] timeStr = parameters.get("time").toString().split("-"); |
| | | int year = Integer.valueOf(timeStr[0]); |
| | | int month = Integer.valueOf(timeStr[1]); |
| | | String yearAndMonth; |
| | | if (month < 10) { |
| | | yearAndMonth = "minutely_" + year + "0" + month; |
| | | } else { |
| | | yearAndMonth = "minutely_" + year + month; |
| | | } |
| | | if (year >= 2020) { |
| | | String yearAndMonth; |
| | | if (month < 10) { |
| | | yearAndMonth = "minutely_" + year + "0" + month; |
| | | } else { |
| | | yearAndMonth = "minutely_" + year + month; |
| | | } |
| | | parameters.put("timeUnits", yearAndMonth); |
| | | } |
| | | } |