| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattAlmparamMapper; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BattAlmparamService { |
| | |
| | | private BattAlmparamMapper mapper; |
| | | //获取电池告警参数 |
| | | public Response getBattAlmParam(AlmDto almDto) { |
| | | return null; |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<BattAlmparam> list = mapper.getBattAlmParam(almDto); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电池告警参数"); |
| | | } |
| | | //修改电池告警参数 |
| | | public Response setBattAlmParam(List<BattAlmparam> almparamList) { |
| | | for (BattAlmparam param:almparamList) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("battgroup_id",param.getBattgroupId()); |
| | | wrapper.eq("alm_id",param.getAlmId()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"修改电池告警参数"); |
| | | } |
| | | } |