whyclxw
2024-07-04 6606e1712e0a97001bb95686a85a82d43cdb065e
山西晋源特定接口
30个文件已修改
1个文件已添加
861 ■■■■■ 已修改文件
src/main/java/com/whyc/mapper/BaoJiGroupMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattDevAlarmDataMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattEnduranceMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattInfMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattalarmDataMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BatttestdataInfMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/Fbs9100StateMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/PowerInfMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/PwrdevAlarmMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/StationInfMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BaoJiGroupService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattEnduranceService.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattalarmDataService.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DevalarmDataService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Fbs9100StateService.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PowerInfService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/PwrdevAlarmService.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationInfService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/ScreenJYSocket.java 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BaoJiGroupMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattDevAlarmDataMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattEnduranceMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattInfMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattalarmDataMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BatttestdataInfMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/Fbs9100StateMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PowerInfMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PwrdevAlarmMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StationInfMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BaoJiGroupMapper.java
@@ -6,6 +6,10 @@
import java.util.List;
public interface BaoJiGroupMapper extends CustomMapper<BaoJiGroup> {
    List<GroupWithStationAndAlarmDTO> getGroupWithStation(int userId);
    //山西晋源特定接口
    List<GroupWithStationAndAlarmDTO> getGroupWithStationJY();
}
src/main/java/com/whyc/mapper/BattDevAlarmDataMapper.java
@@ -4,5 +4,9 @@
public interface BattDevAlarmDataMapper extends CustomMapper<BattDevAlarmData> {
    int searchNums(int uId);
    int getRealTimeWithLevel1(int uId);
    //山西晋源特定接口
    int getRealTimeWithLevel1JY();
}
src/main/java/com/whyc/mapper/BattEnduranceMapper.java
@@ -17,8 +17,15 @@
    //根据电池组查询续航时间
    String getACTime(int battGroupId);
    //山西大屏
    List<BattEndurance> getGroupCapList(int userId);
    //山西晋源特定接口
    List<BattEndurance> getGroupCapListJY();
    List<BattEndurance> getListAndLoadCurr(int userId);
    //山西晋源特定接口
    List<BattEndurance> getListAndLoadCurrJY();
}
src/main/java/com/whyc/mapper/BattInfMapper.java
@@ -88,10 +88,19 @@
    int getBattGroupNum(int userId);
    //山西晋源特定接口
    int getBattGroupNumJY();
    int getDevNum(int userId);
    //山西晋源特定接口
    int getDevNumJY();
    List<Battinf> getBattGroupList(int userId);
    //山西晋源特定接口
    List<Battinf> getBattGroupListJY();
    //单体总数
    int getMonCount(int userId);
src/main/java/com/whyc/mapper/BattalarmDataMapper.java
@@ -36,6 +36,9 @@
    int getRealTimeWithLevel1(int uId);
    //山西晋源特定接口
    int getRealTimeWithLevel1JY();
    //电池单体健康率
    List<AlarmRes> serchGood(int uId);
@@ -66,6 +69,9 @@
    Integer getAlarmHighLow(@Param(value = "userId") int userId, @Param(value = "almSignalId") int almSignalId);
    //山西晋源特定接口
    Integer getAlarmHighLowJY(@Param(value = "almSignalId") int almSignalId);
    //查询实时告警总数
    int getbattAlm(int battGroupId);
src/main/java/com/whyc/mapper/BatttestdataInfMapper.java
@@ -56,6 +56,8 @@
                */
    int getHrQuarterZC(int userId);
    //山西晋源特定接口
    int getHrQuarterZCJY();
    //获取本年已核容电池组
    List<Battinf> getHrYeardisBatt(String userId);
src/main/java/com/whyc/mapper/Fbs9100StateMapper.java
@@ -28,6 +28,9 @@
        List<Fbs9100State> getListWithoutZJDYBTSE2(int userId, int type);
        //山西晋源特定接口
        List<Fbs9100State> getListWithoutZJDYBTSE2JY(@Param("type") int type);
        //今日放电站点统计
        List<DischargeState> getChargeStaticToday(int userId);
src/main/java/com/whyc/mapper/PowerInfMapper.java
@@ -30,6 +30,8 @@
    int getNum(int userId);
    //山西晋源特定接口
    int getNumJY();
    List<PowerInf> getPwrdevInfAnalysis(int userId);
src/main/java/com/whyc/mapper/PwrdevAlarmMapper.java
@@ -21,6 +21,9 @@
    int getRealTimeWithLevel1(int uId);
    //山西晋源特定接口
    int getRealTimeWithLevel1JY();
    //通信电源告警--认证送检-配电柜专用
    List<PwrdevAlarm> getAllPage2(PwrdevAlarm pwrdevAlarm);
@@ -36,8 +39,12 @@
    //查询分级告警的个数
    int serchByLevel(@Param("alarmLevel") int alarmLevel, @Param("uId") int uId, @Param("almTypes") List<Integer> almTypes);
    //山西大屏
    List<PwrdevAlarm> getAnalysis(int userId, List<Integer> types);
    //山西晋源特定接口
    List<PwrdevAlarm> getAnalysisJY( @Param("types") List<Integer> types);
    //查询实时告警总数
    int getpwrAlm(String stationId);
src/main/java/com/whyc/mapper/StationInfMapper.java
@@ -13,11 +13,18 @@
    //总机房
    int getStation(int userId);
    //山西晋源特定接口
    int getStationJY();
    //查询指定机房信息
    StationInf getSystemSkipStation(int userId, String stationId);
    List<StationInf> getStationInfList(int userId);
    //山西晋源特定接口
    List<StationInf> getStationInfListJY();
    List<StationInf> getStationMapAndWorkState(int userId);
    List<String> getStationName1ByUserId(@Param("userId") Integer userId);
src/main/java/com/whyc/service/BaoJiGroupService.java
@@ -148,6 +148,34 @@
            return new Response<>().set(1,false,"发生异常:"+e.getCause());
        }
    }
    //山西晋源特定接口
    public Response getGroupWithStationAndAlarmForScreenJY() {
        try {
            List<GroupWithStationAndAlarmDTO> list = mapper.getGroupWithStationJY();
            list.forEach(item -> {
                List<StationInf> stationInfList = item.getStationInfList();
                List<StationInf> stationInfList2 = stationInfList.stream().collect(Collectors.collectingAndThen(
                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(StationInf::getTogetherFlag))),
                        ArrayList::new));
                item.setStationInfList(stationInfList2);
                item.setStationCount(stationInfList2.size());
                List<String> stationIdList = stationInfList.stream().map(StationInf::getStationId).collect(Collectors.toList());
                //电池
                int battAlarmCount = battAlarmDataService.getCountByStationIds(stationIdList,1);
                item.setBattAlarmCount(battAlarmCount);
                //设备
                int deviceAlarmCount = deviceAlarmDataService.getCountByStationIds(stationIdList,1);
                item.setDeviceAlarmCount(deviceAlarmCount);
                //电源
                int powerAlarmCount = powerAlarmService.getCountByStationIds(stationIdList,1);
                item.setPowerAlarmCount(powerAlarmCount);
            });
            return new Response().set(1, list);
        }catch (Exception e){
            return new Response<>().set(1,false,"发生异常:"+e.getCause());
        }
    }
    public Response getGroupWithStationAndAlarm(int userId) {
        try {
src/main/java/com/whyc/service/BattEnduranceService.java
@@ -137,6 +137,42 @@
    }
    //山西晋源特定接口
    public Response getEnduranceTimeLongJY(int hour){
        try {
            List<BattEndurance> capList = mapper.getListAndLoadCurrJY();
            List<BattEndurance> enduranceLowList = new LinkedList<>();
            for (BattEndurance battEndurance : capList) {
                if (battEndurance.getEnduranceActualTimelong() < hour) {
                    enduranceLowList.add(battEndurance);
                }
            }
            Map<Integer, List<BattEndurance>> collect = enduranceLowList.stream().collect(Collectors.groupingBy(BattEndurance::getNum));
            enduranceLowList.clear();
            Set<Integer> idSet = collect.keySet();
            for (Integer id : idSet) {
                List<BattEndurance> battEnduranceList = collect.get(id);
                BattEndurance battEndurance = battEnduranceList.get(0);
                if (battEnduranceList.size() > 1) {
                    for (int i = 0; i < battEnduranceList.size(); i++) {
                        BattEndurance endurance = battEnduranceList.get(i);
                        if (i == 0) {
                            battEndurance.setLoadCurr(endurance.getLoadCurr());
                        } else {
                            battEndurance.setLoadCurr(battEndurance.getLoadCurr() + "/" + endurance.getLoadCurr());
                        }
                    }
                }
                enduranceLowList.add(battEndurance);
            }
            return new Response().setII(1, enduranceLowList.size(), enduranceLowList, null);
        }catch (Exception e){
            return new Response<>().set(1,false,"发生异常:"+e.getCause());
        }
    }
    /**
     * 测试时间存在,加入统计
     * @param userId
@@ -230,5 +266,94 @@
    }
    //山西晋源特定接口
    public Response getGroupCapListJY(){
        try {
            List<BattEndurance> groupCapList = new LinkedList<>();
            List<BattEndurance> list = mapper.getGroupCapListJY();
            //获取有效数据
            for (BattEndurance battEndurance : list) {
                if(battEndurance.getGroupcount()>1){ //多个电池组
                    Class<? extends BattEndurance> clazz = battEndurance.getClass();
                    String[] testTimeSplit = battEndurance.getBattsTeststarttime().split("/");
                    for (int i = 0; i < testTimeSplit.length; i++) {
                        String testTime = testTimeSplit[i];
                        if(!testTime.equals("-")){ //有效
                            //通过反射获取字段
                            BattEndurance temp = new BattEndurance();
                            Field groupCapField = clazz.getDeclaredField("realCapGroup" + (i + 1));
                            //groupCapField.setAccessible(true);
                            ReflectionUtils.makeAccessible(groupCapField);
                            Float groupCap = (Float) groupCapField.get(battEndurance);
                            temp.setMoncapstd(Float.parseFloat(battEndurance.getBattsMoncapstd().split("/")[i]));
                            temp.setRealCap(groupCap);
                            groupCapList.add(temp);
                        }
                    }
                }else{ //单组
                    BattEndurance temp = new BattEndurance();
                    temp.setRealCap(battEndurance.getRealCapGroup1());
                    temp.setMoncapstd(Float.parseFloat(battEndurance.getBattsMoncapstd()));
                    groupCapList.add(temp);
                }
            }
            Map<Integer,Integer> map = new HashMap<>();
            map.put(1,0);
            map.put(2,0);
            map.put(3,0);
            map.put(4,0);
            map.put(5,0);
            Map<Integer,String> mapPercent = new HashMap<>();
            //获取所有的电池组数
            int totalNum = battInfService.getBattGroupListJY().size();
            //非1等级的数量
            int notLevel1Num=0;
            //获取已经核容的电池组的容量各区间组数
            float capLevel1 = 0.95f;
            float capLevel2 = 0.85f;
            float capLevel3 = 0.6f;
            float capLevel4 = 0.5f;
            for (BattEndurance groupCap : groupCapList) {
                float realCap = groupCap.getRealCap();
                float capStd = groupCap.getMoncapstd();
                Float capPercentF = (Float) MathUtil.divide(realCap, capStd, MathUtil.TYPE_FLOAT);
                if(capPercentF>=capLevel1){
                    map.put(1,map.get(1)+1);
                }
                else if(capPercentF>=capLevel2){
                    map.put(2,map.get(2)+1);
                    notLevel1Num++;
                }
                else if(capPercentF>=capLevel3){
                    map.put(3,map.get(3)+1);
                    notLevel1Num++;
                }
                else if(capPercentF>=capLevel4){
                    map.put(4,map.get(4)+1);
                    notLevel1Num++;
                }
                else{
                    map.put(5,map.get(5)+1);
                    notLevel1Num++;
                }
            }
            //重置等级1的电池组数,未核容的电池组默认是100%,属于等级1
            map.put(1,totalNum-notLevel1Num);
            Set<Integer> levelSet = map.keySet();
            for (Integer level : levelSet) {
                Integer num = map.get(level);
                String percent = (String) MathUtil.divide(num, totalNum, MathUtil.TYPE_FLOAT_PERCENT, 1);
                mapPercent.put(level,percent);
            }
            return new Response().setIII(1, true,mapPercent,map,null);
        }catch (Exception e) {
            return new Response().set(1,false,"发生异常:"+e.getCause());
        }
    }
}
src/main/java/com/whyc/service/BattInfService.java
@@ -652,9 +652,36 @@
        }
    }
    //山西晋源特定接口
    public Response getDevCountMapJY() {
        try {
            Map<String, Object> map = new HashMap<>();
            int battGroupCount = battInfMapper.getBattGroupNumJY();
            int devCount = battInfMapper.getDevNumJY();
            int powerNum = powerInfService.getNumJY();
            List<StationInf> stationInfList = stationInfService.getStationInfListJY();
            int stationNum = stationInfService.getStationJY();
            int hrDisNum = testInfService.getHrQuarterZCJY();
            map.put("battGroupCount", battGroupCount);
            map.put("devCount", devCount);
            map.put("powerNum", powerNum);
            map.put("stationNum",stationNum);
            map.put("stationInfList",stationInfList);
            map.put("checkCapNum",hrDisNum);
            return new Response().setII(1,true, map,"");
        }catch (Exception e){
            return new Response<>().set(1,false,"发生异常:"+e.getCause());
        }
    }
    //大屏
    public List<Battinf> getBattGroupList(int userId) {
        return battInfMapper.getBattGroupList(userId);
    }
    //山西晋源特定接口
    public List<Battinf> getBattGroupListJY() {
        return battInfMapper.getBattGroupListJY();
    }
    //管理员首页:基础资源信息
    @Transactional
src/main/java/com/whyc/service/BattalarmDataService.java
@@ -267,6 +267,12 @@
        return  new Response().set(number);
    }
    //山西晋源特定接口
    public Response getRealTimeWithLevel1JY() {
        int number=mapper.getRealTimeWithLevel1JY();
        return  new Response().set(number);
    }
    //实时1级告警记录查询
    public Response getRealAlarmListWithLevel1(int uId) {
        Calendar instance = Calendar.getInstance();
@@ -663,6 +669,109 @@
        }
    }
    //山西晋源特定接口
    public Response getMonVRTAnalysisJY() {
        Response response = new Response();
        try {
            HashMap<String, Object> resultMap = new HashMap<>();
            Map<String, Object> monVolMap = new HashMap<>();//单体电压  Alarm_vol_Monomer =119005;
            Map<String, Object> monResMap = new HashMap<>();//单体内阻  Alarm_res_Monomer =119007
            Map<String, Object> monTemMap = new HashMap<>();//单体温度  Alarm_tmp_Monomer =119006
            /*======单体电压======*/
            //高告警数量
            Integer volHighAlarmsNum = mapper.getAlarmHighLowJY(AlarmConstant.ALM_SIGNAL_ID_MonVolHigh);
            //低告警数量
            Integer volLowAlarmsNum = mapper.getAlarmHighLowJY(AlarmConstant.ALM_SIGNAL_ID_MonVolLow);
            //单体电压总告警数
            //Integer volTotalAlarmNum = volHighAlarmsNum+volLowAlarmsNum;
            //告警总数
            //Integer totalStationAlarmNum =mapper.getTotalAlarms(userId);
            //电压告警机房数
            //int volTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_vol_Monomer);
            //总机房数
            //int totalStationNum = infoMapper.getStationCount(userId);
            //电压告警占比
            //String volRateStr = (String) MathUtil.divide(volTotalAlarmNum,totalStationAlarmNum,3);
            //电压告警机房占比
            //String volStationRateStr = (String) MathUtil.divide(volTotalAlarmStations,totalStationNum,3);
            monVolMap.put("单体电压高告警", volHighAlarmsNum);     //高告警数量    alm_signal_id 9
            monVolMap.put("单体电压低告警", volLowAlarmsNum);     //低告警数量     alm_signal_id   10
            //monVolMap.put("告警总数", volTotalAlarmNum);        //告警总数
            //monVolMap.put("告警总数比例", volRateStr);      //告警总数比例
            //monVolMap.put("告警机房总数", volTotalAlarmStations);      //告警机房总数
            //monVolMap.put("告警机房数比例", volStationRateStr);    //告警机房数比例
            resultMap.put("单体电压", monVolMap);
            /*======单体内阻======*/
            //高告警数量
            Integer resHighAlarmsNum = mapper.getAlarmHighLowJY( AlarmConstant.ALM_SIGNAL_ID_MonResHigh);
            //低告警数量
            Integer resLowAlarmsNum = mapper.getAlarmHighLowJY(AlarmConstant.ALM_SIGNAL_ID_MonResLow);
            //单体内阻总告警数
            //Integer resTotalAlarmNum = resHighAlarmsNum+resLowAlarmsNum;
            //内阻告警机房数
            //int resTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_res_Monomer);
            //内阻告警占比
            //String resRateStr = (String) MathUtil.divide(resTotalAlarmNum,totalStationAlarmNum,3);
            //内阻告警机房占比
            //String resStationRateStr = (String) MathUtil.divide(resTotalAlarmStations,totalStationNum,3);
            monResMap.put("单体内阻高告警", resHighAlarmsNum);     //高告警数量    alm_signal_id 13
            monResMap.put("单体内阻低告警", resLowAlarmsNum);     //低告警数量     alm_signal_id 14
            //monResMap.put("告警总数", resTotalAlarmNum);        //告警总数
            //monResMap.put("告警总数比例", resRateStr);      //告警总数比例
            //monResMap.put("告警机房总数", resTotalAlarmStations);      //告警机房总数
            //monResMap.put("告警机房数比例", resStationRateStr);    //告警机房数比例
            resultMap.put("单体内阻", monResMap);
            /*======单体温度======*/
            //高告警数量
            Integer tempHighAlarmsNum = mapper.getAlarmHighLowJY(AlarmConstant.ALM_SIGNAL_ID_MonTmpHigh);
            //低告警数量
            Integer tempLowAlarmsNum = mapper.getAlarmHighLowJY(AlarmConstant.ALM_SIGNAL_ID_MonTmpLow);
            //单体温度总告警数
            //Integer tempTotalAlarmNum = tempHighAlarmsNum+tempLowAlarmsNum;
            //温度告警机房数
            //int tempTotalAlarmStations = mapper.getTotalAlarmStations(userId,AlarmConstant.Alarm_tmp_Monomer);
            //温度告警占比
            //String tempRateStr = (String) MathUtil.divide(tempTotalAlarmNum,totalStationAlarmNum,3);
            //温度告警机房占比
            //String tempStationRateStr = (String) MathUtil.divide(tempTotalAlarmStations,totalStationNum,3);
            monTemMap.put("单体温度高告警", tempHighAlarmsNum);     //高告警数量    alm_signal_id 13
            monTemMap.put("单体温度低告警", tempLowAlarmsNum);     //低告警数量     alm_signal_id 14
            //monTemMap.put("告警总数", tempTotalAlarmNum);        //告警总数
            //monTemMap.put("告警总数比例", tempRateStr);      //告警总数比例
            //monTemMap.put("告警机房总数", tempTotalAlarmStations);      //告警机房总数
            //monTemMap.put("告警机房数比例", tempStationRateStr);    //告警机房数比例
            resultMap.put("单体温度", monTemMap);
            return response.setII(1, true, resultMap, "");
        } catch (Exception e) {
            return response.set(1, false, "发生异常:" + e.getCause());
        }
    }
    //今日实时告警
    public Response getBalmToday(int userId) {
        try {
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -584,6 +584,13 @@
        return hrQuarter;
    }
    //山西晋源特定接口
    public int getHrQuarterZCJY() {
        int hrQuarter = mapper.getHrQuarterZCJY();
        return hrQuarter;
    }
    //蓄电池组优劣分析(用蓄电池组组后评估的统计)
    public Response getGroupAnalysis(int userId) {
        try {
src/main/java/com/whyc/service/DevalarmDataService.java
@@ -123,6 +123,10 @@
    public int getRealTimeWithLevel1(int userId) {
        return battDevAlarmDataMapper.getRealTimeWithLevel1(userId);
    }
    //山西晋源特定接口
    public int getRealTimeWithLevel1JY() {
        return battDevAlarmDataMapper.getRealTimeWithLevel1JY();
    }
    //今日实时告警
    public Response getDalmToday(int userId) {
src/main/java/com/whyc/service/Fbs9100StateService.java
@@ -304,6 +304,90 @@
            return response.set(1, false, "发生异常:" + e.getCause());
        }
    }
    //山西晋源特定接口
    public Response getBTSEquipStatus2JY(int type){
        Response response = new Response();
        try {
            Map<String, Integer> resultMap = new HashMap<>();
            resultMap.put("在线浮充数量", 0);
            resultMap.put("预充电数量", 0);
            resultMap.put("核容测试数量", 0);
            resultMap.put("内阻测试数量", 0);
            resultMap.put("通讯故障数量", 0);
            List<Fbs9100State> fbs9100StateList = mapper.getListWithoutZJDYBTSE2JY(type);
            Map<String, List<Fbs9100State>> deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(Fbs9100State::getDevIp));
            Set<String> deviceSet = deviceMap.keySet();
            Calendar instance = Calendar.getInstance();
            instance.add(Calendar.MINUTE, -1);
            Date time = instance.getTime();
            for (String deviceIp : deviceSet) {
                List<Fbs9100State> fbs9100States = deviceMap.get(deviceIp);
                List<Integer> workStateList = fbs9100States.stream().map(Fbs9100State::getDevWorkstate).collect(Collectors.toList());
                Map<Integer, List<Integer>> workStateMap = workStateList.stream().collect(Collectors.groupingBy(Integer::intValue));
                Set<Integer> workStateSet = workStateMap.keySet();
                boolean commError = false;
                for (Fbs9100State state : fbs9100States) {
                    //if (time.compareTo(DateUtil.YYYY_MM_DD_HH_MM_SS.parse(state.getRecordDatetime())) > 0) {
                    if (time.compareTo(ThreadLocalUtil.parse(state.getRecordDatetime(),1)) > 0) {
                        resultMap.put("通讯故障数量", resultMap.get("通讯故障数量") + 1);
                        commError = true;
                        break;
                    }
                }
                //不存在通讯故障,则需要再判断优先级覆盖
                if(!commError){
                    if(workStateSet.contains(DeviceConstant.DEV_NUCLEAR_CAP)) {
                        resultMap.put("核容测试数量", resultMap.get("核容测试数量") + 1);
                    }
                    else if(workStateSet.contains(DeviceConstant.DEV_PRE_CHARGE)) {
                        resultMap.put("预充电数量", resultMap.get("预充电数量") + 1);
                    }
                    else if(workStateSet.contains(DeviceConstant.DEV_RES_TEST)) {
                        resultMap.put("内阻测试数量", resultMap.get("内阻测试数量") + 1);
                    }
                    else if(workStateSet.contains(DeviceConstant.DEV_ONLINE_CHARGE)) {
                        resultMap.put("在线浮充数量", resultMap.get("在线浮充数量") + 1);
                    }
                }
            }
            /*//首先查看是否通讯故障,时间大于1分钟为通讯故障
            for (int i = 0; i < fbs9100StateList.size(); i++) {
                Calendar instance = Calendar.getInstance();
                instance.add(Calendar.MINUTE, -1);
                Date time = instance.getTime();
                if (time.compareTo(DateUtil.YYYY_MM_DD_HH_MM_SS.parse(fbs9100StateList.get(i).getRecordDatetime())) > 0) {
                    resultMap.put("通讯故障数量", resultMap.get("通讯故障数量") + 1);
                } else {
                    switch (fbs9100StateList.get(i).getDevWorkstate()) {
                        case DeviceConstant.DEV_ONLINE_CHARGE:
                            resultMap.put("在线浮充数量", resultMap.get("在线浮充数量") + 1);
                            break;
                        case DeviceConstant.DEV_PRE_CHARGE:
                            resultMap.put("预充电数量", resultMap.get("预充电数量") + 1);
                            break;
                        case DeviceConstant.DEV_NUCLEAR_CAP:
                            resultMap.put("核容测试数量", resultMap.get("核容测试数量") + 1);
                            break;
                        case DeviceConstant.DEV_RES_TEST:
                            resultMap.put("内阻测试数量", resultMap.get("内阻测试数量") + 1);
                            break;
                    }
                }
            }*/
            return response.setII(1, true, resultMap, "");
        } catch (Exception e) {
            return response.set(1, false, "发生异常:" + e.getCause());
        }
    }
    public List<Fbs9100State> getStateList(int userId) {
        List<Fbs9100State> list = mapper.getStateList(userId);
        return list;
src/main/java/com/whyc/service/PowerInfService.java
@@ -128,6 +128,10 @@
    public int getNum(int userId) {
        return mapper.getNum(userId);
    }
    //山西晋源特定接口
    public int getNumJY() {
        return mapper.getNumJY();
    }
    //管理员首页:电源信息
    public List<PowerInf> getPwrdevInfAnalysis(int userId) {
src/main/java/com/whyc/service/PwrdevAlarmService.java
@@ -144,6 +144,11 @@
        return  mapper.getRealTimeWithLevel1(userId);
    }
    //山西晋源特定接口
    public int getRealTimeWithLevel1JY() {
        return  mapper.getRealTimeWithLevel1JY();
    }
    //首页电源总个数
    public int getHomeAlarmNum(int uId) {
        int powerAlarmNum = mapper.getAlarmNum(uId);
@@ -345,6 +350,72 @@
        }
    }
    //山西晋源特定接口
    public Response getAcABCAnalysisJY(){
        //交流A/B/C-过压,
        //交流A/B/C-欠压,
        //交流A/B/C-缺相,
        //交流A/B/C-过流
        Map<String,Integer> resultMap = new HashMap<>();
        resultMap.put("过压",0);
        resultMap.put("欠压",0);
        resultMap.put("缺相",0);
        resultMap.put("过流",0);
        try {
            List<Integer> types = Arrays.asList(
                    AlarmConstant.acIn1_over_volA,
                    AlarmConstant.acIn1_over_volB,
                    AlarmConstant.acIn1_over_volC,
                    AlarmConstant.acIn1_under_volA,
                    AlarmConstant.acIn1_under_volB,
                    AlarmConstant.acIn1_under_volC,
                    AlarmConstant.acIn1_less_A,
                    AlarmConstant.acIn1_less_B,
                    AlarmConstant.acIn1_less_C,
                    AlarmConstant.acb1_over_currA,
                    AlarmConstant.acb1_over_currB,
                    AlarmConstant.acb1_over_currC);
            List<PwrdevAlarm> data = mapper.getAnalysisJY(types);
            for (int i = 0; i < data.size(); i++) {
                switch (data.get(i).getAlmType()) {
                    case AlarmConstant.acIn1_over_volA:
                    case AlarmConstant.acIn1_over_volB:
                    case AlarmConstant.acIn1_over_volC:
                        resultMap.put("过压", resultMap.get("过压") + data.get(i).getNum().intValue());
                        break;
                    case AlarmConstant.acIn1_under_volA:
                    case AlarmConstant.acIn1_under_volB:
                    case AlarmConstant.acIn1_under_volC:
                        resultMap.put("欠压", resultMap.get("欠压") + data.get(i).getNum().intValue());
                        break;
                    case AlarmConstant.acIn1_less_A:
                    case AlarmConstant.acIn1_less_B:
                    case AlarmConstant.acIn1_less_C:
                        resultMap.put("缺相", resultMap.get("缺相") + data.get(i).getNum().intValue());
                        break;
                    case AlarmConstant.acb1_over_currA:
                    case AlarmConstant.acb1_over_currB:
                    case AlarmConstant.acb1_over_currC:
                        resultMap.put("过流", resultMap.get("过流") + data.get(i).getNum().intValue());
                        break;
                    default:
                }
            }
            //告警机房总数和比例
            HashMap<String, Integer> map2 = new HashMap<>();
            List<Map<String, Integer>> mapList = Arrays.asList(resultMap, map2);
            return new Response<>().setII(1, true, mapList, "");
        } catch (Exception e) {
            return new Response<>().set(0, false, "发生异常:"+e.getCause());
        }
    }
    //今日实时告警
    public Response getPalmToday(int userId) {
        try {
src/main/java/com/whyc/service/StationInfService.java
@@ -737,6 +737,10 @@
        return mapper.getStation(userId);
    }
    //山西晋源特定接口
    public int getStationJY() {
        return mapper.getStationJY();
    }
    //运维层首页:头部统计
    public Response getDevOpSkipHead(int userId) {
@@ -981,6 +985,10 @@
    public List<StationInf> getStationInfList(int userId) {
        return mapper.getStationInfList(userId);
    }
    //山西晋源特定接口
    public List<StationInf> getStationInfListJY() {
        return mapper.getStationInfListJY();
    }
    //查询所有的站点电压等级
    public Response searStationType() {
src/main/java/com/whyc/webSocket/ScreenJYSocket.java
New file
@@ -0,0 +1,218 @@
package com.whyc.webSocket;
import com.whyc.config.WebSocketConfig;
import com.whyc.dto.Response;
import com.whyc.factory.ThreadPoolExecutorFactory;
import com.whyc.pojo.Battinf;
import com.whyc.pojo.UserInf;
import com.whyc.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpSession;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
 * 山西太原晋源特定接口
 * 大屏展示 Socket
 */
@Component
@ServerEndpoint(value = "/screenJy",encoders = WebSocketEncoder.class,configurator = WebSocketConfig.class)
public class ScreenJYSocket {
    private Session session;
    private Thread thread;
    private static PwrdevAlarmService powerAlarmService;
    private static BattalarmDataService battAlarmDataService;
    private static Fbs9100StateService fbs9100StateService;
    private static DevalarmDataService devAlarmDataService;
    private static BattInfService battInfService;
    private static BattEnduranceService battEnduranceService;
    private static BaoJiGroupService baoJiGroupService;
    @Autowired
    public void setPowerAlarmService(PwrdevAlarmService powerAlarmService) {
        ScreenJYSocket.powerAlarmService = powerAlarmService;
    }
    @Autowired
    public void setBattAlarmDataService(BattalarmDataService battAlarmDataService) {
        ScreenJYSocket.battAlarmDataService = battAlarmDataService;
    }
    @Autowired
    public void setFbs9100StateService(Fbs9100StateService fbs9100StateService) {
        ScreenJYSocket.fbs9100StateService = fbs9100StateService;
    }
    @Autowired
    public void setDevAlarmDataService(DevalarmDataService devAlarmDataService) {
        ScreenJYSocket.devAlarmDataService = devAlarmDataService;
    }
    @Autowired
    public void setBattInfService(BattInfService battInfService) {
        ScreenJYSocket.battInfService = battInfService;
    }
    @Autowired
    public void setBattEnduranceService(BattEnduranceService battEnduranceService) {
        ScreenJYSocket.battEnduranceService = battEnduranceService;
    }
    @Autowired
    public void setBaoJiGroupService(BaoJiGroupService baoJiGroupService) {
        ScreenJYSocket.baoJiGroupService = baoJiGroupService;
    }
    @OnOpen
    public void onOpen(Session session){
        this.session = session;
        Thread thread = new Thread() {
            @Override
            public void run() {
                try {
                    Map<String, Object> res = new HashMap<>();
                    while (!currentThread().isInterrupted()) {
                        ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor();
                        CountDownLatch latch = new CountDownLatch(9);
                        poolExecutor.execute(()->{
                            //一体   告警:交流ABC
                            //Response res_acABC = powerAlarmService.getAcABCAnalysis(userId);
                            Response res_acABC = powerAlarmService.getAcABCAnalysisJY();
                            res.put("acABC", res_acABC);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   组端容量
                            //Response res_groupCap = battEnduranceService.getGroupCapList(userId);
                            Response res_groupCap = battEnduranceService.getGroupCapListJY();
                            res.put("groupCap", res_groupCap);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   告警:单体温度内阻温度
                            //Response res_monVRTAnalysis = battAlarmDataService.getMonVRTAnalysis(userId);
                            Response res_monVRTAnalysis = battAlarmDataService.getMonVRTAnalysisJY();
                            res.put("monVRTAnalysis", res_monVRTAnalysis);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   统计:三种设备类型 告警数统计
                            Response res_devAlarmNum = new Response();
                            Map<String, Integer> devAlarmNumMap = new HashMap<>();
                            try {
                                //int battAlarmNum = battAlarmDataService.getRealTimeWithLevel1(userId).getCode();
                                //int devAlarmNum = devAlarmDataService.getRealTimeWithLevel1(userId);
                                //int powerAlarmNum = powerAlarmService.getRealTimeWithLevel1(userId);
                                int battAlarmNum = battAlarmDataService.getRealTimeWithLevel1JY().getCode();
                                int devAlarmNum = devAlarmDataService.getRealTimeWithLevel1JY();
                                int powerAlarmNum = powerAlarmService.getRealTimeWithLevel1JY();
                                devAlarmNumMap.put("battAlarmNum",battAlarmNum);
                                devAlarmNumMap.put("devAlarmNum",devAlarmNum);
                                devAlarmNumMap.put("powerAlarmNum",powerAlarmNum);
                                res_devAlarmNum.setII(1,true,devAlarmNumMap,null);
                            }catch (Exception e){
                                res_devAlarmNum.set(1,false,"发生异常:"+e.getCause());
                            }
                            res.put("devAlarmNum", res_devAlarmNum);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   统计:电池统计 分为品牌和标称电压
                            Response res_battGroupInfo = new Response();
                            try {
                                //List<Battinf> battinfList = battInfService.getBattGroupList(userId);
                                List<Battinf> battinfList = battInfService.getBattGroupListJY();
                                Map<String, List<Battinf>> battProducerMap = battinfList.stream().collect(Collectors.groupingBy(Battinf::getBattProducer));
                                Map<Float, List<Battinf>> battMonVolStdMap = battinfList.stream().collect(Collectors.groupingBy(Battinf::getMonVolStd));
                                Map<String, Object> battGroupProducerMap = new HashMap<>();
                                Map<String, Object> battGroupMonVolMap = new HashMap<>();
                                Map<String, Object> battGroupInfoMap = new HashMap<>();
                                int battSize = battinfList.size();
                                for (String producer : battProducerMap.keySet()) {
                                    battGroupProducerMap.put(producer, battProducerMap.get(producer).size());
                                }
                                for (Float monVolStd : battMonVolStdMap.keySet()) {
                                    battGroupMonVolMap.put(Float.toString(monVolStd), battMonVolStdMap.get(monVolStd).size());
                                }
                                battGroupInfoMap.put("producer",battGroupProducerMap);
                                battGroupInfoMap.put("monVol",battGroupMonVolMap);
                                battGroupInfoMap.put("totalNum",battSize);
                                res_battGroupInfo.setII(1,true,battGroupInfoMap,null);
                            }catch (Exception e){
                                res_battGroupInfo.set(1,false,"发生异常:"+e.getCause());
                            }
                            res.put("battGroupInfo", res_battGroupInfo);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   统计:设备状态
                            //Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus2(userId,1);
                            Response<Map> res_devStates = fbs9100StateService.getBTSEquipStatus2JY(1);
                            res.put("devStates", res_devStates);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //一体   统计:各种设备类型总数 电池 设备 电源 站点
                            //Response<Map> res_devCountMap = battInfService.getDevCountMap(userId);
                            Response<Map> res_devCountMap = battInfService.getDevCountMapJY();
                            res.put("devCountMap", res_devCountMap);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //Response res_endurance = battEnduranceService.getEnduranceTimeLong(userId,4);
                            Response res_endurance = battEnduranceService.getEnduranceTimeLongJY(4);
                            res.put("enduranceLow", res_endurance);
                            latch.countDown();
                        });
                        poolExecutor.execute(()->{
                            //Response res_groupInfo = baoJiGroupService.getGroupWithStationAndAlarmForScreen(userId);
                            Response res_groupInfo = baoJiGroupService.getGroupWithStationAndAlarmForScreenJY();
                            res.put("res_groupInfo", res_groupInfo);
                            latch.countDown();
                        });
                        latch.await(10, TimeUnit.MINUTES);
                        session.getBasicRemote().sendObject(new Response().set(1, res));
                        sleep(4000);
                    }
                } catch (Exception e) {
                    this.interrupt();
                }
            }
        };
        thread.start();
        this.thread = thread;
    }
    @OnClose
    public void onClose(CloseReason closeReason) throws IOException {
        //System.err.println("closeReason = " + closeReason);
        if(session.isOpen()){
            session.close();
        }
    }
    @OnError
    public void onError(Throwable error) throws IOException {
        //error.printStackTrace();
        thread.isInterrupted();
        if(session.isOpen()){
            session.close();
        }
    }
}
src/main/resources/mapper/BaoJiGroupMapper.xml
@@ -35,4 +35,16 @@
        and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid = #{userId}) order by s.stationName
    </select>
    <select id="getGroupWithStationJY" resultMap="Map_GroupWithStation">
        SELECT b.baoji_group_name,s.* FROM
                                          db_user.tb_user_battgroup_baojigroup b,
                                          db_user.tb_user_battgroup_baojigroup_battgroup bb,
                                          db_battinf.tb_station_inf s
        where b.baoji_group_id = bb.baoji_group_id
          and bb.StationId = s.stationId
          and b.discharge_plan_flag = 1
    </select>
</mapper>
src/main/resources/mapper/BattDevAlarmDataMapper.xml
@@ -25,4 +25,11 @@
        and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid=#{uId} )
    </select>
    <select id="getRealTimeWithLevel1JY" resultType="java.lang.Integer">
        select count(dev_id)
        from db_alarm.tb_devalarm_data
        where alm_level=1
    </select>
</mapper>
src/main/resources/mapper/BattEnduranceMapper.xml
@@ -65,6 +65,12 @@
        LEFT OUTER JOIN db_user.tb_user_inf ON tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
        WHERE db_user.tb_user_inf.uid = #{userId})
    </select>
    <select id="getGroupCapListJY" resultType="com.whyc.pojo.BattEndurance">
        select * from web_site.tb_batt_endurance
        where batts_teststarttime!="-" and batts_teststarttime!="-/-"
    </select>
    <select id="getListAndLoadCurr" resultType="com.whyc.pojo.BattEndurance">
        select e.*,b.StationName as stationName,b.LoadCurrFromDis as loadCurr from web_site.tb_batt_endurance e,db_battinf.tb_battinf b
        where e.stationid = b.StationId
@@ -77,6 +83,12 @@
        WHERE db_user.tb_user_inf.uid = #{userId})
    </select>
    <select id="getListAndLoadCurrJY" resultType="com.whyc.pojo.BattEndurance">
        select e.*,b.StationName as stationName,b.LoadCurrFromDis as loadCurr from web_site.tb_batt_endurance e,db_battinf.tb_battinf b
        where e.stationid = b.StationId
          and e.batts_teststarttime!="-" and e.batts_teststarttime!="-/-"
    </select>
    <resultMap id="BattInfAndEndurance" type="com.whyc.dto.BattInfAndEnduranceDTO">
        <association property="battInf" javaType="com.whyc.pojo.Battinf">
src/main/resources/mapper/BattInfMapper.xml
@@ -546,6 +546,11 @@
        and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid=#{userId})
    </select>
    <select id="getBattGroupNumJY" resultType="java.lang.Integer">
        select count(*) from db_battinf.tb_battinf
    </select>
    <select id="getDevNum" resultType="java.lang.Integer">
        select count(distinct FBSDeviceIp) from db_battinf.tb_battinf where StationId in(select distinct db_battinf.tb_battinf.StationId
        from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf
@@ -554,6 +559,11 @@
        and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid=#{userId})
    </select>
    <select id="getDevNumJY" resultType="java.lang.Integer">
        select count(distinct FBSDeviceIp) from db_battinf.tb_battinf
    </select>
    <select id="getBattGroupList" resultType="com.whyc.pojo.Battinf">
        select battProducer,monVolStd from db_battinf.tb_battinf where StationId in(select distinct db_battinf.tb_battinf.StationId
        from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf
@@ -562,6 +572,12 @@
        and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid=#{userId})
    </select>
    <select id="getBattGroupListJY" resultType="com.whyc.pojo.Battinf">
        select battProducer,monVolStd from db_battinf.tb_battinf
    </select>
    <select id="getMonCount" resultType="java.lang.Integer">
        select sum(MonCount)
        from db_battinf.tb_battinf
src/main/resources/mapper/BattalarmDataMapper.xml
@@ -169,6 +169,12 @@
        and db_user.tb_user_inf.uid=#{uId}  )
    </select>
    <select id="getRealTimeWithLevel1JY" parameterType="java.lang.Integer" resultType="java.lang.Integer">
        select count(num) as number from db_alarm.tb_battalarm_data
        where
        alm_level=1
    </select>
    <select id="serchGood" parameterType="java.lang.Integer" resultType="AlarmStaticRes">
        SELECT battgroupid,count(DISTINCT MonNum) as number,alm_id
        FROM db_alarm.tb_battalarm_data
@@ -422,6 +428,17 @@
        )
    </select>
    <select id="getAlarmHighLowJY" resultType="java.lang.Integer">
        SELECT count(*)
        FROM db_alarm.tb_battalarm_data alarm,
             db_battinf.tb_battinf inf
        WHERE alarm.BattGroupId = inf.BattGroupId
          AND alm_cleared_type = 0
          AND alm_signal_id = #{almSignalId}
    </select>
    <select id="getbattAlm" resultType="java.lang.Integer">
        select count(1)
        from db_alarm.tb_battalarm_data
src/main/resources/mapper/BatttestdataInfMapper.xml
@@ -351,6 +351,18 @@
      and db_user.tb_user_inf.uid = #{userId})
    </where>
  </select>
  <select id="getHrQuarterZCJY" resultType="java.lang.Integer">
    SELECT count(distinct BattGroupId)
    From db_batt_testdata.tb_batttestdata_inf
    <where>
      YEAR (test_starttime) = YEAR (NOW())
      and test_type=3
      and test_starttype=3
      and (test_stoptype in (3, 4, 6)
      or (test_stoptype=2 and test_timelong>=7200))
    </where>
  </select>
  <select id="searchHrYear" resultType="batttestdataInf">
    SELECT *
    From db_batt_testdata.tb_batttestdata_inf
src/main/resources/mapper/Fbs9100StateMapper.xml
@@ -191,6 +191,17 @@
        and db_user.tb_user_inf.uid = #{userId}
            )
    </select>
    <select id="getListWithoutZJDYBTSE2JY" resultType="com.whyc.pojo.Fbs9100State">
        select distinct state.*
        from db_ram_db.tb_fbs9100_state state,
        db_battinf.tb_battinf battInf
        where state.dev_id = battInf.fbsdeviceId
        <if test="type==1">
            and battInf.FBSDeviceName != "ZJDYBTSE2"
        </if>
    </select>
    <select id="getList2WithoutZJDYBTSE2" resultType="com.whyc.pojo.Fbs9100State">
        select distinct battInf.FBSDeviceIp as fbsDeviceIp,state.*
        from db_ram_db.tb_fbs9100_state state,
src/main/resources/mapper/PowerInfMapper.xml
@@ -211,6 +211,12 @@
                              and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
                              and db_user.tb_user_inf.uid = #{uId})
    </select>
    <select id="getNumJY" resultType="java.lang.Integer">
        select count(PowerDeviceId)
        from db_pwrdev_inf.tb_pwrdev_inf
    </select>
    <select id="getPwrdevInfAnalysis" resultType="com.whyc.pojo.PowerInf">
        select PowerProducer
        from db_pwrdev_inf.tb_pwrdev_inf
src/main/resources/mapper/PwrdevAlarmMapper.xml
@@ -133,6 +133,13 @@
        and db_user.tb_user_inf.uid=#{uid} ) ;
    </select>
    <select id="getRealTimeWithLevel1JY" parameterType="java.lang.Integer" resultType="java.lang.Integer">
        select count(*) as num from db_pwrdev_alarm.tb_pwrdev_alarm alarm,db_pwrdev_inf.tb_pwrdev_inf inf
        where alarm.PowerDeviceId = inf.PowerDeviceId
          and alarm.alm_level=1
    </select>
    <select id="getAllPage2" resultType="com.whyc.pojo.PwrdevAlarm">
        select  alarm.*,inf.StationName,inf.PowerDeviceName from db_pwrdev_alarm.tb_pwrdev_alarm alarm,db_pwrdev_inf.tb_pwrdev_inf inf
        <where>
@@ -305,6 +312,18 @@
        and db_user.tb_user_inf.uid=#{userId} )
        group by alm_type
    </select>
    <select id="getAnalysisJY" resultType="com.whyc.pojo.PwrdevAlarm">
        select alm_type as almType,count(alm_type) as num
        from db_pwrdev_alarm.tb_pwrdev_alarm alarm,db_pwrdev_inf.tb_pwrdev_inf inf
        where alarm.PowerDeviceId = inf.PowerDeviceId
        and alm_type in
        <foreach collection="types" separator="," open="(" close=")" item="alarm_type">
            #{alarm_type}
        </foreach>
        group by alm_type
    </select>
    <select id="getpwrAlm" resultType="java.lang.Integer">
        select count(1)
        from db_pwrdev_alarm.tb_pwrdev_alarm
src/main/resources/mapper/StationInfMapper.xml
@@ -104,6 +104,12 @@
                              and db_user.tb_user_inf.uid = #{userId})
    </select>
    <select id="getStationJY" resultType="java.lang.Integer">
        select count(distinct together_flag)
        from db_battinf.tb_station_inf
    </select>
    <select id="getSystemSkipStation" resultMap="SystemRt">
        select distinct *
        from db_battinf.tb_station_inf
@@ -130,6 +136,13 @@
        and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid = #{userId})
    </select>
    <select id="getStationInfListJY" resultType="com.whyc.pojo.StationInf">
        select distinct s.*,state.dev_workstate as devWorkState
        from db_battinf.tb_station_inf s,db_ram_db.tb_fbs9100_state state,db_battinf.tb_battinf b
        where s.stationId = b.StationId and b.FBSDeviceId = state.dev_id
    </select>
    <select id="getStationMapAndWorkState" resultType="com.whyc.pojo.StationInf">
        select distinct inf.*,state.dev_workstate as devWorkState
        from db_battinf.tb_station_inf inf,db_ram_db.tb_fbs9100_state state,db_battinf.tb_battinf battInf