| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | |
| | | PageInfo<AFERectifierState> afeInverterStatePageInfo = new PageInfo<>(afeInverterStates); |
| | | return new Response<PageInfo<AFERectifierState>>().set(1,afeInverterStatePageInfo); |
| | | } |
| | | |
| | | |
| | | public Response updateState1(int devId, int rectifierRun) { |
| | | UpdateWrapper<AFERectifierState> wrapper = Wrappers.update(); |
| | | wrapper.set("rectifier_run",rectifierRun).eq("dev_id",devId); |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | |
| | | public Response updateState2(int devId, int invertRun) { |
| | | UpdateWrapper<AFERectifierState> wrapper = Wrappers.update(); |
| | | wrapper.set("invert_run",invertRun).eq("dev_id",devId); |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |