| | |
| | | String sensorCode = params.get("sensorCode").toString(); |
| | | String end; |
| | | String timeUnits; |
| | | |
| | | String dateFormat; |
| | | //返回结果集,time=data |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | |
| | | if ("hour".equals(type)) { |
| | | end = DateUtils.getDateAddDay(start, 1); |
| | | timeUnits = "hourly"; |
| | | dateFormat = "%Y-%m-%d %H"; |
| | | } else if ("day".equals(type)) { |
| | | end = DateUtils.getDateAddMonth(start, 1); |
| | | timeUnits = "daily"; |
| | | dateFormat = "%Y-%m-%d"; |
| | | } else { |
| | | end = DateUtils.getDateAddYear(start, 1); |
| | | timeUnits = "monthly"; |
| | | dateFormat = "%Y-%m"; |
| | | } |
| | | params.put("timeUnits", timeUnits); |
| | | params.put("start", start); |
| | | params.put("end", end); |
| | | params.put("macs", macs); |
| | | params.put("dateFormat", "%Y-%m-%d %H:%i:%s"); |
| | | params.put("dateFormat", dateFormat); |
| | | //获取多设备指定因子数据 |
| | | List<Map<String, Object>> list = deviceMapper.getTrendChartData(params); |
| | | |