| | |
| | | List<BattalarmData> getList(@Param("uId") Long userId); |
| | | |
| | | //查询分级告警的个数 |
| | | int serchByLevel(int alarmLevel); |
| | | int serchByLevel(@Param("alarmLevel") int alarmLevel, @Param("uId") int uId); |
| | | } |
| | |
| | | } |
| | | |
| | | //查询分级告警的个数 |
| | | public Response serchByLevel() { |
| | | public Response serchByLevel(int uId) { |
| | | List list = new ArrayList(); |
| | | //分四级查询个数 |
| | | for (int i = 1; i <= 4; i++) { |
| | | int countLevel = mapper.serchByLevel(i); |
| | | int countLevel = mapper.serchByLevel(i, uId); |
| | | list.add(countLevel); |
| | | } |
| | | return new Response().setII(1, list.size() > 0, list, "分级告警数"); |
| | |
| | | Response unconfirmedAlarms = service.serchByConditionOfWebSocket(alarmPar); |
| | | res.put("unconfirmedAlarms", unconfirmedAlarms); |
| | | //查询分级告警的个数 |
| | | Response levelRes = service.serchByLevel(); |
| | | Response levelRes = service.serchByLevel(alarmPar.getUId()); |
| | | res.put("levelRes", levelRes); |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | |
| | | from db_alarm.tb_battalarm_data, |
| | | db_battinf.tb_battinf |
| | | where alm_level = #{alarmLevel} |
| | | and db_alarm.tb_battalarm_data.BattGroupId |
| | | in (select distinct db_battinf.tb_battinf.battgroupid |
| | | 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 = #{uId}) |
| | | </select> |
| | | </mapper> |