| | |
| | | package com.whyc.service; |
| | | |
| | | 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.PwrdevAlarmParamMapper; |
| | | import com.whyc.pojo.db_param.BattAlmparam; |
| | | import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmParamService { |
| | | @Autowired(required = false) |
| | | private PwrdevAlarmParamMapper mapper; |
| | | |
| | | //获取电源告警参数 |
| | | public Response getPwrAlmParam(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<PwrdevAlarmParam> list = mapper.getPwrAlmParam(almDto); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电源告警参数"); |
| | | } |
| | | //修改电源告警参数 |
| | | public Response setPwrAlmParam(List<PwrdevAlarmParam> almparamList) { |
| | | for (PwrdevAlarmParam param:almparamList) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("power_id",param.getPowerId()); |
| | | wrapper.eq("alm_id",param.getAlmId()); |
| | | mapper.update(param,wrapper); |
| | | } |
| | | return new Response().set(1,true,"修改电源告警参数"); |
| | | } |
| | | } |