| | |
| | | private LockAlarmHisService service; |
| | | @ApiOperation("查询锁告警的历史状态") |
| | | @GetMapping("getLockAlmHis") |
| | | public Response getLockAlmHis(@RequestParam(required = false) Integer areaId,@RequestParam(required = false) Integer almId, @RequestParam String startTime, @RequestParam String endTime |
| | | public Response getLockAlmHis(@RequestParam(required = false) Integer areaId,@RequestParam(required = false) String almIds, @RequestParam String startTime, @RequestParam String endTime |
| | | , @RequestParam int pageNum, @RequestParam int pageSize) throws ParseException, InterruptedException { |
| | | Response res=service.getLockAlmHis(areaId,almId,startTime,endTime,pageNum,pageSize); |
| | | Response res=service.getLockAlmHis(areaId,almIds,startTime,endTime,pageNum,pageSize); |
| | | return res; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "告警类型") |
| | | private Integer almId; |
| | | |
| | | @TableField(exist = false) |
| | | private String almIds; |
| | | |
| | | @ApiModelProperty(value = "告警来源[1-平台触发 2-手机APP触发 3-锁具触发]") |
| | | private Integer almSource; |
| | | |
| | |
| | | |
| | | |
| | | //查询锁告警的历史状态 |
| | | public Response getLockAlmHis(Integer areaId, Integer almId,String startTime, String endTime, int pageNum, int pageSize) throws ParseException { |
| | | public Response getLockAlmHis(Integer areaId, String almIds,String startTime, String endTime, int pageNum, int pageSize) throws ParseException { |
| | | LockAlarmHis his=new LockAlarmHis(); |
| | | if(areaId!=null){ |
| | | List<Integer> areaList=new ArrayList(); |
| | |
| | | his.setLids(lockIdList); |
| | | } |
| | | } |
| | | his.setAlmId(almId); |
| | | his.setAlmIds(almIds); |
| | | PageInfo pageInfo=util.getPageInfo(pageNum,pageSize, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1) |
| | | ,"db_lock_alarm","tb_lock_alarm",his); |
| | | return new Response().setII(1,pageInfo.getList()!=null,pageInfo,"查询锁告警的历史状态"); |
| | |
| | | if(his.getEndTime()!=null){ |
| | | sql+=" and alm_start_time <='"+ThreadLocalUtil.format(his.getEndTime(),1)+"' "; |
| | | } |
| | | if(his.getAlmIds()!=null){ |
| | | String[] almId=his.getAlmIds().split(","); |
| | | sql+=" and history.alm_id in ("; |
| | | for (int i=0;i<almId.length;i++) { |
| | | if(i==almId.length-1){ |
| | | sql=sql+almId[i]+") "; |
| | | }else{ |
| | | sql=sql+almId[i]+","; |
| | | } |
| | | } |
| | | } |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | |
| | | if(his.getEndTime()!=null){ |
| | | sql+=" and alm_start_time <='"+ThreadLocalUtil.format(his.getEndTime(),1)+"' "; |
| | | } |
| | | if(his.getAlmIds()!=null){ |
| | | String[] almId=his.getAlmIds().split(","); |
| | | sql+=" and history.alm_id in ("; |
| | | for (int i=0;i<almId.length;i++) { |
| | | if(i==almId.length-1){ |
| | | sql=sql+almId[i]+") "; |
| | | }else{ |
| | | sql=sql+almId[i]+","; |
| | | } |
| | | } |
| | | } |
| | | sql+=" ORDER BY alm_start_time asc limit "+ his.getLimitStart()+","+ his.getLimitEnd()+" "; |
| | | List<LockAlarmHis> list=sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |