whycrzg
2021-05-21 e4cd7fd3e48a5280d15cfbf07ca5e1e18b4f74d0
src/main/java/com/whyc/controller/RectifierPowerController.java
@@ -1,7 +1,9 @@
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.CentralMonitorSysST;
import com.whyc.pojo.RectifierPowerRT;
import com.whyc.service.RectifierPowerService;
import io.swagger.annotations.Api;
@@ -11,6 +13,9 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("rectifierPower")
@@ -32,4 +37,21 @@
        return service.getInfoByDevId(devId);
    }
    @GetMapping("field")
    @ApiOperation(value = "查询告警阈值字段")
    public Response<Map<String, List>> getField(){
        return service.getField();
    }
    /**
     * ======History======
     * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询
     * TODO 待确定是否需要加上日期
     * */
    @GetMapping("history/all")
    @ApiOperation(value = "查询历史记录")
    public Response<PageInfo<RectifierPowerRT>> getHistory(@RequestParam int pageNum, int pageSize, int devId){
        return service.getHistory(pageNum,pageSize,devId);
    }
}