| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.sql.Array; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | params.put("timeUnits",timeUnits); |
| | | params.put("mac",mac); |
| | | List resultList = new ArrayList(); |
| | | for (int i = 0; i < 13; i++) { |
| | | for (int i = 0; i < 25; i++) { |
| | | Map<String,Object> oneHourDateMap = new HashMap<>(); |
| | | String j; |
| | | if (i<10){ |
| | |
| | | } |
| | | String time = date+j; |
| | | params.put("time",time); |
| | | String resultTime = time.substring(0,13); |
| | | if (ObjectUtils.isEmpty(historyHourlyMapper.selectHourlyData(params))){ |
| | | oneHourDateMap.put("time",resultTime); |
| | | oneHourDateMap.put("values",new ArrayList<>()); |
| | | resultList.add(oneHourDateMap); |
| | | continue; |
| | | } |
| | |
| | | sensorDate = sensorDate.replace("[",""); |
| | | sensorDate = sensorDate.replace("]",""); |
| | | String[] split = sensorDate.split(","); |
| | | oneHourDateMap.put("time",time); |
| | | oneHourDateMap.put("time",resultTime); |
| | | oneHourDateMap.put("values",split); |
| | | resultList.add(oneHourDateMap); |
| | | } |