whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/util/SubTablePageInfoUtils.java
@@ -2,6 +2,7 @@
import com.github.pagehelper.PageInfo;
import com.whyc.dto.InterfaceParam;
import com.whyc.dto.UpsAlarmDTO;
import com.whyc.dto.paramter.AlarmPar;
import com.whyc.dto.paramter.DevAlarmPar;
import com.whyc.dto.result.AlarmRes;
@@ -134,6 +135,19 @@
                    queryCountMap.put(tableYear,currentCount);
                }
            }
            else if (pojo instanceof UpsAlarmDTO) {
                //ups不存在初始表,跳过
                if(tableYear.equals("default")){
                    continue;
                }
                UpsAlarmDTO param = (UpsAlarmDTO) pojo;
                param.setAlmStartTime(queryTime.get(0));
                param.setAlmEndTime(queryTime.get(1));
                param.setRecordYear(tableName);
                //int currentCount = powerAlarmHistoryMapper.getCount(param);
                int currentCount = subService.getCountForUps(param);
                queryCountMap.put(tableYear, currentCount);
            }
        }
        //分页信息
@@ -201,6 +215,20 @@
                data.setRecordYear(recordYear);
                //List<DevalarmDataHistory> list = devAlarmDataHistoryMapper.getList2(data);
                List<DevalarmDataHistory> list =  subService.getList2(data);
                dataList.addAll(list);
            }
            else if (pojo instanceof UpsAlarmDTO) {
                UpsAlarmDTO data = (UpsAlarmDTO) pojo;
                data.setAlmStartTime(queryTime.get(0));
                data.setAlmEndTime(queryTime.get(1));
                List<Integer> limitList = tableAndLimitMap.get(key);
                data.setLimitStart(limitList.get(0));
                data.setLimitEnd(limitList.get(1));
                data.setRecordYear(recordYear);
                //List<DevalarmDataHistory> list = devAlarmDataHistoryMapper.getList2(data);
                List<UpspwrdevAlarmHistory> list =  subService.getList2(data);
                dataList.addAll(list);
            }
@@ -331,7 +359,8 @@
                    param.setAlmStartTime1(queryTime.get(1));
                    param.setRecordYear(tableName);
                    //int currentCount = devAlarmDataHistoryMapper.getCount(param);
                    int currentCount = subService.getCount(param);
                    //int currentCount = subService.getCount(param);
                    int currentCount = subService.getCount_stationId(param);
                    queryCountMap.put(tableYear, currentCount);
                } else if (pojo instanceof PwrdevAlarmHistory) {
@@ -449,7 +478,8 @@
                data.setLimitEnd(limitList.get(1));
                data.setRecordYear(recordYear);
                //List<DevalarmDataHistory> list = devAlarmDataHistoryMapper.getList2(data);
                List<DevalarmDataHistory> list =  subService.getList2(data);
                //List<DevalarmDataHistory> list =  subService.getList2(data);
                List<DevalarmDataHistory> list =  subService.getList2_stationId(data);
                dataList.addAll(list);
            }
            else if (pojo instanceof PwrdevAlarmHistory) {
@@ -531,13 +561,16 @@
            List<BattalarmDataHistory> levelInfoSubList;
            List<Integer> levelSubList;
            if(tableLike.equals("tb_battalarm_data_history")) {
                levelInfoSubList = battAlarmDataHistoryMapper.getLevelSubList(uId, tableName);
                //levelInfoSubList = battAlarmDataHistoryMapper.getLevelSubList(uId, tableName);
                levelInfoSubList = subService.getLevelSubList_batt(uId, tableName);
            }
            else if(tableLike.equals("tb_devalarm_data_history")){
                levelInfoSubList = devAlarmDataHistoryMapper.getLevelSubList(uId, tableName);
                //levelInfoSubList = devAlarmDataHistoryMapper.getLevelSubList(uId, tableName);
                levelInfoSubList = subService.getLevelSubList_dev(uId, tableName);
            }
            else{
                levelInfoSubList = powerAlarmHistoryMapper.getLevelSubList(uId, tableName,almTypes);
                //levelInfoSubList = powerAlarmHistoryMapper.getLevelSubList(uId, tableName,almTypes);
                levelInfoSubList = subService.getLevelSubList_pwr(uId, tableName,almTypes);
            }
            levelSubList = levelInfoSubList.stream().map(BattalarmDataHistory::getAlmLevel).collect(Collectors.toList());
            levelList.addAll(levelSubList);