| | |
| | | List<Battinf> getInfInStation(String stationId); |
| | | //1统计机房个数,设备个数,电池组个数(苏州地铁) |
| | | List<Battinf> getAllInfInSz2(Integer userId); |
| | | //查询battinf表中所有机房信息 |
| | | List<Battinf> getAllStationInSz2(Integer userId); |
| | | } |
| | |
| | | List<DevalarmData> getListByStationIds(List<String> stationIdList); |
| | | |
| | | List<DevalarmData> getLevelListByUserId(int userId); |
| | | //判断机房下的设备告警是否都存在通讯告警 119020 |
| | | int judgeCommErr(@Param("stationId") String stationId,@Param("almType") int almType); |
| | | } |
| | |
| | | @Autowired(required = false) |
| | | private BaoJiGroupBattGroupMapper bjBattMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private DevalarmDataMapper devAlmMapper; |
| | | |
| | | public int searchMaxBattgroupId_zj() { |
| | | Integer id = battInfMapper.getMaxBattGroupId_zj(); |
| | | if (id == null) { |
| | |
| | | int devNum=0; |
| | | int battNum=0; |
| | | try { |
| | | //查询battinf表中所有机房信息 |
| | | //查询battinf表中所有电池组信息 |
| | | List<Battinf> list=battInfMapper.getAllInfInSz2(userId); |
| | | Map<String, List<Battinf>> ListMap = list.stream().collect(Collectors.groupingBy(Battinf::getStationName9)); |
| | | for (String stationName9 : ListMap.keySet()) { |
| | |
| | | } |
| | | |
| | | } |
| | | //4.中间地图 |
| | | public Response getAllStationInSz2(Integer userId) { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | try { |
| | | //查询battinf表中所有机房信息 |
| | | List<Battinf> list=battInfMapper.getAllStationInSz2(userId); |
| | | Map<String, List<Battinf>> ListMap = list.stream().collect(Collectors.groupingBy(Battinf::getStationName9)); |
| | | for (String stationName9 : ListMap.keySet()) { |
| | | List<Battinf> name9List=ListMap.get(stationName9); |
| | | for (Battinf binf:name9List) { |
| | | //判断机房下的设备告警是否都存在通讯告警 119020 |
| | | int flag=devAlmMapper.judgeCommErr(binf.getStationId(),119020); |
| | | if(flag>0){ |
| | | binf.setNote("0"); |
| | | }else{ |
| | | binf.setNote("1"); |
| | | } |
| | | } |
| | | map.put(stationName9,name9List); |
| | | } |
| | | return new Response<>().setII(1,true,map,""); |
| | | } catch (Exception e) { |
| | | return new Response<>().set(1,false,""); |
| | | } |
| | | } |
| | | } |
| | |
| | | public Map<String, Object> getStatic(Integer userId) throws InterruptedException { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(3); |
| | | CountDownLatch latch = new CountDownLatch(4); |
| | | poolExecutor.execute(()->{ |
| | | //1统计机房个数,设备个数,电池组个数 |
| | | Response<Map> res_inf = battInfService.getAllInfInSz2(userId); |
| | |
| | | res.put("res_battState", res_battState); |
| | | latch.countDown(); |
| | | }); |
| | | poolExecutor.execute(()->{ |
| | | //4.中间地图 |
| | | Response<Map> res_station = battInfService.getAllStationInSz2(userId); |
| | | res.put("res_station", res_station); |
| | | latch.countDown(); |
| | | }); |
| | | |
| | | latch.await(10, TimeUnit.MINUTES); |
| | | return res; |
| | |
| | | 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="getAllStationInSz2" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct stationId, stationName1,stationName2,stationName3,stationName5,stationName9 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 |
| | | where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId = |
| | | db_battinf.tb_battinf.BattGroupId |
| | | and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id = |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid = #{userId}) |
| | | </select> |
| | | </mapper> |
| | |
| | | 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="judgeCommErr" resultType="java.lang.Integer"> |
| | | select count(*) from db_alarm.tb_devalarm_data ,db_battinf.tb_battinf |
| | | WHERE tb_devalarm_data.dev_id=tb_battinf.FBSDeviceId |
| | | and alm_type=#{almType} and tb_battinf.stationid=#{stationId} |
| | | </select> |
| | | </mapper> |