| | |
| | | |
| | | //查询实时告警总数 |
| | | int getbattAlm(String stationId); |
| | | |
| | | //今日实时告警 |
| | | List<BattalarmData> getBalmToday(int userId); |
| | | } |
| | |
| | | import com.whyc.pojo.BattdischargePlan; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BattdischargePlanMapper extends CustomMapper<BattdischargePlan>{ |
| | |
| | | List<BattdischargePlan> judgePlan(BattdischargePlan plan); |
| | | |
| | | //创建计划-创建计划 |
| | | int addPro(@Param("list")List<BattdischargePlan> list); |
| | | int addPro(@Param("list") List<BattdischargePlan> list); |
| | | |
| | | |
| | | int searchByStationId(@Param("stationId") String stationId); |
| | |
| | | List<BattMapInformation> findTimeoutStation(); |
| | | |
| | | int searchNums(int uId); |
| | | |
| | | //监控层首页:今日放电任务统计 |
| | | List<BattdischargePlan> getPlanStaticToday(int userId); |
| | | } |
| | |
| | | |
| | | //查询实时告警总数 |
| | | int getdevAlm(String stationId); |
| | | |
| | | //今日实时告警 |
| | | List<DevalarmData> getDalmToday(int userId); |
| | | } |
| | |
| | | |
| | | //查询实时告警总数 |
| | | int getpwrAlm(String stationId); |
| | | |
| | | //今日实时告警 |
| | | List<PwrdevAlarm> getPalmToday(int userId); |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.whyc.dto.Page; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date dischargeStoptime; |
| | | |
| | | @ApiModelProperty(value = "放电状态 0未开始放电,1放电延时 2放电完成 3放电进行,4放电失败") |
| | | private Integer dischargeState; |
| | | |
| | | private String dischargeReason; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Transactional |
| | |
| | | //monTemMap.put("告警机房数比例", tempStationRateStr); //告警机房数比例 |
| | | resultMap.put("单体温度", monTemMap); |
| | | |
| | | return response.setII(1,true,resultMap,null); |
| | | }catch (Exception e){ |
| | | return response.set(1,false,"发生异常:"+e.getCause()); |
| | | return response.setII(1, true, resultMap, null); |
| | | } catch (Exception e) { |
| | | return response.set(1, false, "发生异常:" + e.getCause()); |
| | | } |
| | | } |
| | | |
| | | //今日实时告警 |
| | | public Response getBalmToday(int userId) { |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int btatolNum = 0; |
| | | Map<String, Integer> bAlmClearMap = new HashMap<>(); |
| | | List<BattalarmData> bAlmList = mapper.getBalmToday(userId); |
| | | Map<Integer, List<BattalarmData>> bclearedMap = bAlmList.stream().collect(Collectors.groupingBy(BattalarmData::getAlmClearedType)); |
| | | for (Integer cleared : bclearedMap.keySet()) { |
| | | bAlmClearMap.put(String.valueOf(cleared), bclearedMap.get(cleared).size()); |
| | | btatolNum += bclearedMap.get(cleared).size(); |
| | | } |
| | | Map<String, Integer> bAlmLevelMap = new HashMap<>(); |
| | | Map<Integer, List<BattalarmData>> blevelMap = bAlmList.stream().collect(Collectors.groupingBy(BattalarmData::getAlmLevel)); |
| | | for (Integer level : blevelMap.keySet()) { |
| | | bAlmLevelMap.put(String.valueOf(level), blevelMap.get(level).size()); |
| | | btatolNum += blevelMap.get(level).size(); |
| | | } |
| | | map.put("bAlmClearMap", bAlmClearMap); |
| | | map.put("bAlmLevelMap", bAlmLevelMap); |
| | | map.put("btatolNum", btatolNum); |
| | | return new Response().set(1, true, "今日实时告警"); |
| | | } catch (Exception e) { |
| | | return new Response().set(1, false, "出现异常" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.BattTestData; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattRtstateMapper; |
| | | import com.whyc.mapper.BattdischargePlanMapper; |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.pojo.BattMapInformation; |
| | | import com.whyc.pojo.BattRtstate; |
| | | import com.whyc.pojo.BattdischargePlan; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | //创建计划-创建计划 |
| | | public Response addPro(List<BattdischargePlan> list) { |
| | | int flag=mapper.addPro(list); |
| | | return new Response().set(flag>0?1:0); |
| | | int flag = mapper.addPro(list); |
| | | return new Response().set(flag > 0 ? 1 : 0); |
| | | } |
| | | |
| | | public List<BattMapInformation> findTimeoutStation(){ |
| | | public List<BattMapInformation> findTimeoutStation() { |
| | | return mapper.findTimeoutStation(); |
| | | } |
| | | |
| | | //监控层首页:今日放电任务统计 |
| | | public List<BattdischargePlan> getPlanStaticToday(int userId) { |
| | | List<BattdischargePlan> planList = mapper.getPlanStaticToday(userId); |
| | | return planList; |
| | | } |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.ListIterator; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DevalarmDataService { |
| | |
| | | public int getAlarmNum(int userId) { |
| | | return battDevAlarmDataMapper.searchNums(userId); |
| | | } |
| | | |
| | | //今日实时告警 |
| | | public Response getDalmToday(int userId) { |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int dtatolNum = 0; |
| | | Map<String, Integer> dAlmClearMap = new HashMap<>(); |
| | | List<DevalarmData> dAlmList = mapper.getDalmToday(userId); |
| | | Map<Integer, List<DevalarmData>> dclearedMap = dAlmList.stream().collect(Collectors.groupingBy(DevalarmData::getAlmClearedType)); |
| | | for (Integer cleared : dclearedMap.keySet()) { |
| | | dAlmClearMap.put(String.valueOf(cleared), dclearedMap.get(cleared).size()); |
| | | dtatolNum += dclearedMap.get(cleared).size(); |
| | | } |
| | | Map<String, Integer> dAlmLevelMap = new HashMap<>(); |
| | | Map<Integer, List<DevalarmData>> dlevelMap = dAlmList.stream().collect(Collectors.groupingBy(DevalarmData::getAlmLevel)); |
| | | for (Integer level : dlevelMap.keySet()) { |
| | | dAlmLevelMap.put(String.valueOf(level), dlevelMap.get(level).size()); |
| | | dtatolNum += dlevelMap.get(level).size(); |
| | | } |
| | | map.put("dAlmClearMap", dAlmClearMap); |
| | | map.put("dAlmLevelMap", dAlmLevelMap); |
| | | map.put("dtatolNum", dtatolNum); |
| | | return new Response().set(1, true, "今日实时告警"); |
| | | } catch (Exception e) { |
| | | return new Response().set(1, false, "出现异常" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmService { |
| | |
| | | //map2.put("告警机房数比例",(int)MathUtil.divide(alarmStationCount,stationCount,2)); |
| | | |
| | | List<Map<String, Integer>> mapList = Arrays.asList(resultMap, map2); |
| | | return new Response<>().setII(1, true,mapList,null); |
| | | }catch (Exception e){ |
| | | return new Response<>().set(0,false,"发生异常"); |
| | | return new Response<>().setII(1, true, mapList, null); |
| | | } catch (Exception e) { |
| | | return new Response<>().set(0, false, "发生异常"); |
| | | } |
| | | } |
| | | |
| | | //今日实时告警 |
| | | public Response getPalmToday(int userId) { |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int ptatolNum = 0; |
| | | Map<String, Integer> pAlmClearMap = new HashMap<>(); |
| | | List<PwrdevAlarm> pAlmList = mapper.getPalmToday(userId); |
| | | Map<Integer, List<PwrdevAlarm>> pclearedMap = pAlmList.stream().collect(Collectors.groupingBy(PwrdevAlarm::getAlmClearedType)); |
| | | for (Integer cleared : pclearedMap.keySet()) { |
| | | pAlmClearMap.put(String.valueOf(cleared), pclearedMap.get(cleared).size()); |
| | | ptatolNum += pclearedMap.get(cleared).size(); |
| | | } |
| | | Map<String, Integer> pAlmLevelMap = new HashMap<>(); |
| | | Map<Integer, List<PwrdevAlarm>> plevelMap = pAlmList.stream().collect(Collectors.groupingBy(PwrdevAlarm::getAlmLevel)); |
| | | for (Integer level : plevelMap.keySet()) { |
| | | pAlmLevelMap.put(String.valueOf(level), plevelMap.get(level).size()); |
| | | ptatolNum += plevelMap.get(level).size(); |
| | | } |
| | | map.put("pAlmClearMap", pAlmClearMap); |
| | | map.put("pAlmLevelMap", pAlmLevelMap); |
| | | map.put("ptatolNum", ptatolNum); |
| | | return new Response().set(1, true, "今日实时告警"); |
| | | } catch (Exception e) { |
| | | return new Response().set(1, false, "出现异常" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.whyc.webSocket; |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.service.StationInfService; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.BattdischargePlan; |
| | | import com.whyc.service.BattalarmDataService; |
| | | import com.whyc.service.BattdischargePlanService; |
| | | import com.whyc.service.DevalarmDataService; |
| | | import com.whyc.service.PwrdevAlarmService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 监控层首页 |
| | |
| | | |
| | | private volatile Map<Long, Boolean> threadFlagMap = new HashMap<>(); |
| | | |
| | | private static StationInfService service; |
| | | private static BattdischargePlanService planService; |
| | | |
| | | private static BattalarmDataService bAlmService; |
| | | |
| | | private static DevalarmDataService dAlmService; |
| | | |
| | | private static PwrdevAlarmService pAlmService; |
| | | |
| | | |
| | | private Session session; |
| | | |
| | | @Autowired |
| | | public void setStationInfService(StationInfService service) { |
| | | HomeMonitorSocket.service = service; |
| | | public void setBattdischargePlanService(BattdischargePlanService planService) { |
| | | HomeMonitorSocket.planService = planService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setBattalarmDataService(BattalarmDataService bAlmService) { |
| | | HomeMonitorSocket.bAlmService = bAlmService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setDevalarmDataService(DevalarmDataService dAlmService) { |
| | | HomeMonitorSocket.dAlmService = dAlmService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setPwrdevAlarmService(PwrdevAlarmService pAlmService) { |
| | | HomeMonitorSocket.pAlmService = pAlmService; |
| | | } |
| | | |
| | | @OnOpen |
| | |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | | session.getBasicRemote().sendObject(service.getMonitorAll(userId)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Response planRes = new Response<>(); |
| | | List<BattdischargePlan> planList = new ArrayList<>(); |
| | | //今日放电任务统计 |
| | | try { |
| | | Map<String, Integer> planMap = new HashMap<>(); |
| | | planList = planService.getPlanStaticToday(userId); |
| | | Map<Integer, List<BattdischargePlan>> disMap = planList.stream().collect(Collectors.groupingBy(BattdischargePlan::getDischargeState)); |
| | | for (Integer dischargeState : disMap.keySet()) { |
| | | planMap.put(String.valueOf(dischargeState), disMap.get(dischargeState).size()); |
| | | } |
| | | planMap.put("sumNum", planList.size()); |
| | | planRes.setII(1, planList.size() > 0, map, "今日放电任务统计"); |
| | | } catch (Exception e) { |
| | | planRes.set(1, false, "出现异常" + e.getMessage()); |
| | | } |
| | | map.put("planRes", planRes); |
| | | map.put("planList", planList); |
| | | //今日实时告警 |
| | | Response bAlmRes = bAlmService.getBalmToday(userId); |
| | | map.put("bAlmRes", bAlmRes); |
| | | Response bDebRes = dAlmService.getDalmToday(userId); |
| | | map.put("bDebRes", bDebRes); |
| | | Response bPwrRes = pAlmService.getPalmToday(userId); |
| | | map.put("bPwrRes", bPwrRes); |
| | | session.getBasicRemote().sendObject(map); |
| | | } |
| | | threadFlagMap.put(thread.getId(), false); |
| | | } |
| | |
| | | <result property="almId" column="alm_id"></result> |
| | | <result property="almSignalId" column="alm_signal_id"></result> |
| | | <result property="monNum" column="monnum"></result> |
| | | <result property="almValue" column="alm_value" ></result> |
| | | <result property="almLevel" column="alm_level" ></result> |
| | | <result property="almIsConfirmed" column="alm_is_confirmed" ></result> |
| | | <result property="almConfirmedTime" column="alm_confirmed_time" ></result> |
| | | <result property="almStartTime" column="alm_start_time" ></result> |
| | | <result property="almEndTime" column="alm_end_time" ></result> |
| | | <result property="almValue" column="alm_value"></result> |
| | | <result property="almLevel" column="alm_level"></result> |
| | | <result property="almIsConfirmed" column="alm_is_confirmed"></result> |
| | | <result property="almConfirmedTime" column="alm_confirmed_time"></result> |
| | | <result property="almStartTime" column="alm_start_time"></result> |
| | | <result property="almEndTime" column="alm_end_time"></result> |
| | | </collection> |
| | | |
| | | </resultMap> |
| | |
| | | from db_battinf.tb_battinf |
| | | where tb_battinf.stationid = #{stationId}) |
| | | </select> |
| | | <select id="getBalmToday" resultType="com.whyc.pojo.BattalarmData"> |
| | | SELECT alm_level, alm_cleared_type |
| | | from db_alarm.tb_battalarm_data |
| | | where TO_DAYS(alm_start_time) = TO_DAYS(NOW()) |
| | | and 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 = #{userId}) |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.BattdischargePlanMapper"> |
| | | <select id="serchByCondition" resultType="com.whyc.pojo.BattdischargePlan"> |
| | | select distinct(tb_battdischarge_plan.battgroupid),tb_battdischarge_plan.num,tb_battdischarge_plan.battIndexInFbs,tb_battdischarge_plan.discharge_starttime,tb_battdischarge_plan.discharge_stoptime, |
| | | select |
| | | distinct(tb_battdischarge_plan.battgroupid),tb_battdischarge_plan.num,tb_battdischarge_plan.battIndexInFbs,tb_battdischarge_plan.discharge_starttime,tb_battdischarge_plan.discharge_stoptime, |
| | | tb_battdischarge_plan.discharge_state,tb_battdischarge_plan.discharge_reason,tb_battdischarge_plan.discharge_cleartype,tb_battdischarge_plan.note, |
| | | tb_battdischarge_plan.preset_time,tb_battdischarge_plan.preset_cap,tb_battdischarge_plan.preset_monvol,tb_battdischarge_plan.preset_groupvol,tb_battdischarge_plan.preset_curr,tb_battdischarge_plan.preset_mon, |
| | | tb_battdischarge_plan.dcvolhighlimit,tb_battdischarge_plan.chargecurrset,plan_circle,plan_rate, |
| | |
| | | from web_site.tb_battdischarge_plan |
| | | left outer join db_battinf.tb_battinf on tb_battdischarge_plan.battgroupid=db_battinf.tb_battinf.battgroupid |
| | | <where> |
| | | tb_battdischarge_plan.discharge_starttime>=#{dischargeStarttime} and tb_battdischarge_plan.discharge_starttime<=#{dischargeStarttime1} |
| | | <if test="dischargeState==-1"> |
| | | tb_battdischarge_plan.discharge_starttime>=#{dischargeStarttime} and |
| | | tb_battdischarge_plan.discharge_starttime<=#{dischargeStarttime1} |
| | | <if test="dischargeState==-1"> |
| | | and tb_battdischarge_plan.discharge_state!=-1 |
| | | </if> |
| | | <if test="dischargeState!=-1"> |
| | |
| | | <select id="searchNums" resultType="java.lang.Integer"> |
| | | select count(num) |
| | | from web_site.tb_battdischarge_plan |
| | | where discharge_state=0 |
| | | and 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}) |
| | | where discharge_state = 0 |
| | | and 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> |
| | | |
| | | <insert id="addPro"> |
| | | insert into web_site.tb_battdischarge_plan(battgroupid,battIndexInFbs,discharge_starttime,discharge_state,discharge_reason,discharge_cleartype,preset_time,preset_cap,preset_monvol,preset_groupvol,preset_curr,preset_mon,dcvolhighlimit,chargecurrset,plan_circle,plan_rate) |
| | | insert into |
| | | web_site.tb_battdischarge_plan(battgroupid,battIndexInFbs,discharge_starttime,discharge_state,discharge_reason,discharge_cleartype,preset_time,preset_cap,preset_monvol,preset_groupvol,preset_curr,preset_mon,dcvolhighlimit,chargecurrset,plan_circle,plan_rate) |
| | | VALUES |
| | | <foreach collection="list" item="p" separator=","> |
| | | <foreach collection="list" item="p" separator=","> |
| | | (#{p.battgroupid},#{p.BattIndexInFbs},#{p.dischargeStarttime},#{p.dischargeState},#{p.dischargeReason},#{p.dischargeCleartype},#{p.presetTime},#{p.presetCap},#{p.presetMonvol},#{p.presetGroupvol},#{p.presetCurr},#{p.presetMon},#{p.dcvolhighlimit},#{p.chargecurrset},#{p.planCircle},#{p.planRate}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="getPlanStaticToday" resultType="com.whyc.pojo.BattdischargePlan"> |
| | | select discharge_state |
| | | from web_site.tb_battdischarge_plan |
| | | where TO_DAYS(discharge_starttime) = TO_DAYS(NOW()) |
| | | and discharge_state not in (2, 4) |
| | | and tb_battdischarge_plan.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 = #{userId}) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | from db_battinf.tb_battinf |
| | | where tb_battinf.stationid = #{stationId}) |
| | | </select> |
| | | <select id="getDalmToday" resultType="com.whyc.pojo.DevalarmData"> |
| | | SELECT alm_level, alm_cleared_type |
| | | from db_alarm.tb_devalarm_data |
| | | where TO_DAYS(alm_start_time) = TO_DAYS(NOW()) |
| | | and tb_devalarm_data.dev_id in (select distinct db_battinf.tb_battinf.FbsDeviceId |
| | | 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> |
| | |
| | | </select> |
| | | |
| | | <select id="getPwrdevAlarm2" resultType="com.whyc.pojo.PwrdevAlarm"> |
| | | select alarm.*,inf.StationName,inf.StationName3 from db_pwrdev_alarm.tb_pwrdev_alarm alarm,db_pwrdev_inf.tb_pwrdev_inf |
| | | select alarm.*,inf.StationName,inf.StationName3 from db_pwrdev_alarm.tb_pwrdev_alarm |
| | | alarm,db_pwrdev_inf.tb_pwrdev_inf |
| | | inf |
| | | where alarm.PowerDeviceId = inf.PowerDeviceId |
| | | <!--and alarm.PowerDeviceId in |
| | |
| | | from db_battinf.tb_battinf |
| | | where tb_battinf.stationid = #{stationId}) |
| | | </select> |
| | | <select id="getPalmToday" resultType="com.whyc.pojo.PwrdevAlarm"> |
| | | SELECT alm_level, alm_cleared_type |
| | | from db_pwrdev_alarm.tb_pwrdev_alarm |
| | | where TO_DAYS(alm_start_time) = TO_DAYS(NOW()) |
| | | and tb_pwrdev_alarm.PowerDeviceId in (select distinct db_battinf.tb_battinf.FbsDeviceId |
| | | 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> |