|  |  |  | 
|---|
|  |  |  | String startTime = parameters.get("startTime").toString(); | 
|---|
|  |  |  | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | 
|---|
|  |  |  | LocalDateTime startTimeLocalDateTime = LocalDateTime.parse(startTime, dateTimeFormatter); | 
|---|
|  |  |  | LocalDateTime today = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS); | 
|---|
|  |  |  | LocalDateTime startTimeDay = startTimeLocalDateTime.truncatedTo(ChronoUnit.DAYS); | 
|---|
|  |  |  | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM"); | 
|---|
|  |  |  | int format = Integer.parseInt(sdf.format(new Date())); | 
|---|
|  |  |  | int year = startTimeLocalDateTime.getYear(); | 
|---|
|  |  |  | int month = startTimeLocalDateTime.getMonthValue(); | 
|---|
|  |  |  | String monthStr = month < 10 ? ("0" + month) : month + ""; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | parameters.put("sensorKeys", sensorKeys); | 
|---|
|  |  |  | List<Map<String, Object>> listMap = null; | 
|---|
|  |  |  | /*if (today.compareTo(startTimeDay) == 0) { | 
|---|
|  |  |  | listMap = historyMapper.listGetSensorData(parameters); | 
|---|
|  |  |  | }*/ | 
|---|
|  |  |  | //if (CollectionUtils.isEmpty(listMap)) { | 
|---|
|  |  |  | listMap = historyMapper.getCarSensorData(parameters); | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(listMap)) { | 
|---|
|  |  |  | if (year <= 2019) { | 
|---|
|  |  |  | listMap = historyMinutelyMapper.getSensorData(parameters); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | parameters.put("yearAndMonth", yearAndMonth); | 
|---|
|  |  |  | listMap = historyMinutelyMapper.getSensorData2020(parameters); | 
|---|
|  |  |  | if (Integer.parseInt(yearAndMonth) <= format) { | 
|---|
|  |  |  | parameters.put("yearAndMonth", yearAndMonth); | 
|---|
|  |  |  | listMap = historyMinutelyMapper.getSensorData2020(parameters); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //} | 
|---|