| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.param.request.EventSubRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.DeviceMapper; |
| | | import com.doumee.dao.business.WarningMapper; |
| | |
| | | queryWrapper.orderByDesc(WarningRule::getCreateDate); |
| | | IPage<WarningRule> result = warningRuleMapper.selectJoinPage(page, WarningRule.class,queryWrapper); |
| | | if(result.getRecords()!=null && result.getRecords().size()>0){ |
| | | List<WarningRuleDetail> allList = warningRuleDetailMapper.selectList(new LambdaQueryWrapper<WarningRuleDetail>() |
| | | .eq(WarningRuleDetail::getIsdeleted,Constants.ZERO)); |
| | | List<WarningRuleDetail> allList = warningRuleDetailMapper.selectJoinList(WarningRuleDetail.class, |
| | | new MPJLambdaWrapper<WarningRuleDetail>() |
| | | .selectAll(WarningRuleDetail.class) |
| | | .selectAs(Warning::getName,WarningRuleDetail::getWarningName) |
| | | .leftJoin(Warning.class,Warning::getId,WarningRuleDetail::getWarningId) |
| | | .eq(WarningRuleDetail::getIsdeleted,Constants.ZERO)); |
| | | for(WarningRule model :result.getRecords()){ |
| | | model.setDetailList(getDetailListFromAll(allList,model.getId())); |
| | | } |
| | |
| | | QueryWrapper<WarningRule> wrapper = new QueryWrapper<>(warningRule); |
| | | return warningRuleMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatus(WarningRule param) { |
| | | WarningRule model = warningRuleMapper.selectById(param.getId()); |
| | | if (model==null || Constants.equalsInteger(model.getIsdeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(model.getStatus(),param.getStatus())){ |
| | | return; |
| | | } |
| | | model.setStatus(param.getStatus()); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(param.getLoginUserInfo().getId()); |
| | | warningRuleMapper.updateById(model); |
| | | } |
| | | } |