| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | | import com.whyc.dto.Param.ParamAlmDto; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattAlmparamMapper; |
| | |
| | | public class BattAlmparamService { |
| | | @Autowired(required = false) |
| | | private BattAlmparamMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private BattInfService binfService; |
| | | //获取电池告警参数 |
| | | public Response getBattAlmParam(Integer battgroupId) { |
| | | public Response getBattAlmParam(ParamAlmDto dto) { |
| | | //根据查询条件获取电池组集合 |
| | | List<Integer> idList=binfService.getBattgroupIdList(dto); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | if(idList!=null){ |
| | | wrapper.in("battgroup_id",idList); |
| | | } |
| | | if(dto.getAlmIdList()!=null){ |
| | | wrapper.in("alm_id",dto.getAlmIdList()); |
| | | } |
| | | wrapper.orderByAsc("alm_id"); |
| | | PageHelper.startPage(dto.getPageNum(),dto.getPageSize()); |
| | | List<BattAlmparam> list = mapper.selectList(wrapper); |
| | | return new Response().setII(1,list!=null,list,"获取电池告警参数"); |
| | | PageInfo<BattAlmparam> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电池告警参数"); |
| | | } |
| | | //修改电池告警参数 |
| | | public Response setBattAlmParam(List<BattAlmparam> almparamList) { |