| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import com.whyc.service.AFERectifierService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("afeRectifier") |
| | | @Api(tags = "afe变频器-整流器的数据信息") |
| | | public class AFERectifierController { |
| | | |
| | | @Autowired |
| | | AFERectifierService service; |
| | | |
| | | @GetMapping("all") |
| | | @ApiOperation(value = "查询所有数据信息") |
| | | public Response<IPage<AFERectifierState>> getAll(@RequestParam int pageNum, int pageSize){ |
| | | return service.getAll(pageNum,pageSize); |
| | | } |
| | | |
| | | @GetMapping("infoByDevId") |
| | | @ApiOperation(value = "查询单个数据信息:根据设备id") |
| | | public Response<AFERectifierState> getInfoByDevId(@RequestParam int devId){ |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | @PutMapping("updateState1") |
| | | @ApiOperation(value = "更新整流状态-演示使用") |
| | | public Response updateState1(@RequestParam int devId,@RequestParam int rectifierRun){ |
| | | return service.updateState1(devId,rectifierRun); |
| | | } |
| | | |
| | | @PutMapping("updateState2") |
| | | @ApiOperation(value = "更新逆变状态-演示使用") |
| | | public Response updateState2(@RequestParam int devId,@RequestParam int invertRun){ |
| | | return service.updateState2(devId,invertRun); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<AFERectifierState>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | } |