whycxzp
2025-03-31 a127882c8f15593783fcf0a1489835c16db70682
src/main/java/com/whyc/util/SubTablePageInfoUtil.java
@@ -9,6 +9,7 @@
import com.whyc.pojo.db_alarm.DevLithiumAlarmDataYear;
import com.whyc.pojo.db_lithium_ram_db.DevLithiumInf;
import com.whyc.pojo.db_power_alarm.PowerAlarmHistory;
import com.whyc.pojo.db_power_history.BattStationTempHistory;
import com.whyc.pojo.db_user.UserInf;
import com.whyc.service.DevLithiumInfService;
import com.whyc.service.SubTableService;
@@ -175,7 +176,7 @@
                                                    Date startTime, Date endTime,
                                                    String dbName, String tablePrefix,
                                                    Object pojo) throws ParseException, InterruptedException {
        Map<String, List<Date>> queryTimeForSubTables = DateUtil.getQueryTimeForSubTablesByMonthDesc(startTime, endTime);
        Map<String, List<Date>> queryTimeForSubTables = DateUtil.getQueryTimeForSubTablesByMonthDesc2(startTime, endTime);
        //查询分表是否存在,存在则查询结果
        Map<String,Integer> queryCountMap = new LinkedHashMap<>();
        Set<String> tableYearKeySet = queryTimeForSubTables.keySet();
@@ -218,6 +219,14 @@
                    battAlarmHistory.setAlmEndTime(queryTime.get(1));
                    battAlarmHistory.setRecordYear(tableName);
                    int currentCount = service.getBattHisCount(battAlarmHistory);
                    queryCountMap.put(tableYear, currentCount);
                 }
                else if (pojo instanceof BattStationTempHistory) {
                    BattStationTempHistory tempHistory = new BattStationTempHistory();
                    tempHistory.setStartTime(queryTime.get(0));
                    tempHistory.setEndTime(queryTime.get(1));
                    tempHistory.setRecordYearMonth(tableName);
                    int currentCount = service.getBattStationTempHisCount(tempHistory);
                    queryCountMap.put(tableYear, currentCount);
                 }
                latch.countDown();
@@ -269,6 +278,16 @@
                battAlarmHistory.setLimitEnd(limitList.get(1));
                List<BattAlarmHistory> list =  service.getBattHisList(battAlarmHistory);
                dataList.addAll(list);
            }else if (pojo instanceof BattStationTempHistory){
                BattStationTempHistory tempHistory = new BattStationTempHistory();
                tempHistory.setStartTime(queryTime.get(0));
                tempHistory.setEndTime(queryTime.get(1));
                tempHistory.setRecordYearMonth(recordYear);
                List<Integer> limitList = tableAndLimitMap.get(key);
                tempHistory.setLimitStart(limitList.get(0));
                tempHistory.setLimitEnd(limitList.get(1));
                List<BattStationTempHistory> list =  service.getBattStationTempHisList(tempHistory);
                dataList.addAll(list);
            }
        }
        pageInfo.setList(dataList);