| | |
| | | @Autowired |
| | | private BattAlarmHisService hisService; |
| | | |
| | | @ApiOperation("在用电池组实时推送告警信息") |
| | | @GetMapping("getResBattAlm") |
| | | public Response getResBattAlm(@RequestParam(required = false) int binfId){ |
| | | Response res=service.getResBattAlm(binfId); |
| | | return res; |
| | | } |
| | | |
| | | @ApiOperation("查询电池告警") |
| | | @GetMapping("getBattAlarm") |
| | | public Response getBattAlarm(@RequestParam(required = false) int almLevel,@RequestParam String startTime,@RequestParam String endTime |
| | |
| | | @Autowired |
| | | private PowerAlarmHistoryService hisService; |
| | | |
| | | @ApiOperation("在用电源实时推送告警信息") |
| | | @GetMapping("getResPowerAlm") |
| | | public Response getResPowerAlm(@RequestParam(required = false) int pinfId){ |
| | | Response res=service.getResPowerAlm(pinfId); |
| | | return res; |
| | | } |
| | | |
| | | |
| | | @ApiOperation("查询电源告警") |
| | | @GetMapping("getPowerAlarm") |
| | | public Response getPowerAlarm(@RequestParam(required = false) int almLevel, @RequestParam String startTime, @RequestParam String endTime |
| | |
| | | |
| | | public interface PowerAlarmMapper extends CustomMapper<PowerAlarm>{ |
| | | //查询电源告警 |
| | | List<PowerAlarm> getPowerAlarm(int almLevel, Date parse, Date parse1); |
| | | List<PowerAlarm> getPowerAlarm(int almLevel, Date startTime, Date endTime); |
| | | |
| | | //在用电源实时推送告警信息 |
| | | List<PowerAlarm> getResPowerAlm(int pinfId); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.whyc.mapper.*; |
| | | import com.whyc.pojo.db_batt.PowerInf; |
| | | import com.whyc.pojo.db_power_alarm.PowerAlarm; |
| | | import com.whyc.pojo.db_real_batt.RtData; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired(required = false) |
| | | private PowerRealRt3Mapper realRt3Mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private PowerAlarmMapper pAlarmMapper; |
| | | |
| | | //根据id获取电源信息 |
| | | public Map<String,Object> getInfById(int powerId) { |
| | | Map<String,Object> map=new HashMap<>(); |
| | |
| | | } |
| | | Object obj=getRealRt(powerId,devType); |
| | | map.put("realRt"+devType,obj); |
| | | |
| | | List<PowerAlarm> powerAlarmList=pAlarmMapper.getResPowerAlm(powerId); |
| | | map.put("powerAlarm",powerAlarmList); |
| | | return map; |
| | | } |
| | | //获取电电源信息 |
| | |
| | | <mapper namespace="com.whyc.mapper.BattAlarmMapper"> |
| | | |
| | | <select id="getBattAlarm" resultType="com.whyc.pojo.db_alarm.BattAlarm"> |
| | | select batt_alarm.*,batt_inf.binf_name from db_alarm.batt_alarm,db_batt.power_inf |
| | | select batt_alarm.*,power_inf.binf_name from db_alarm.batt_alarm,db_batt.power_inf |
| | | <where> |
| | | batt_alarm.binf_id=power_inf.binf_id |
| | | and batt_alarm.alm_start_time>=#{startTime} |
| | |
| | | <mapper namespace="com.whyc.mapper.PowerAlarmMapper"> |
| | | |
| | | <select id="getPowerAlarm" resultType="com.whyc.pojo.db_power_alarm.PowerAlarm"> |
| | | select power_alarm.*,batt_inf.power_name from db_power_alarm.power_alarm,db_batt.power_inf |
| | | select power_alarm.*,power_inf.power_name from db_power_alarm.power_alarm,db_batt.power_inf |
| | | <where> |
| | | power_alarm.power_id=power_inf.power_id |
| | | and power_alarm.alm_start_time>=#{startTime} |