| | |
| | | }else{ |
| | | sqlend = calendar_start.get(Calendar.YEAR)+"%"; |
| | | } |
| | | List<String> tableNameList = mapper.getTableNameList(deviceId+"_"+sqlend); |
| | | List<String> tableNameList = mapper.getTableNameList("tb_pwrdev_historydata_"+deviceId+"_"+sqlend); |
| | | //如果未查询到表名,则没有数据 |
| | | if (tableNameList.size()==0){ |
| | | return new Response().set(1, false, "数据表不存在"); |
| | |
| | | } |
| | | //当结束时间与表名的月份相同时,获取结束时间前的数据 |
| | | if (Integer.valueOf(tableName.substring(tableName.length()-2))==endMonth){ |
| | | List<PwrdevDataHistory> listMonth = mapper.getLtEndTime(tableName,endTime); |
| | | //List<PwrdevDataHistory> listMonth = mapper.getLtEndTime(tableName,endTime); |
| | | List<PwrdevDataHistory> listMonth = subService.getLtEndTime(tableName,endTime); |
| | | result.addAll(listMonth); |
| | | } |
| | | } |
| | |
| | | for (String tableName: tableNameList ) { |
| | | int month = calendar_start.get(Calendar.MONTH)+1; |
| | | if (Integer.valueOf(tableName.substring(tableName.length()-2))==month){ |
| | | List<PwrdevDataHistory> listMonth = mapper.getWeekOrDayData(tableName,startTime,endTime); |
| | | //List<PwrdevDataHistory> listMonth = mapper.getWeekOrDayData(tableName,startTime,endTime); |
| | | List<PwrdevDataHistory> listMonth = subService.getWeekOrDayData(tableName,startTime,endTime); |
| | | result.addAll(listMonth); |
| | | } |
| | | } |