whycxzp
2021-03-05 e7a7b634352f684085bb6eea34b331fc069ff44d
src/main/java/com/whyc/service/CentralMonitorSysRTService.java
@@ -1,19 +1,31 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.CentralMonitorSysRTHistoryMapper;
import com.whyc.mapper.CentralMonitorSysRTMapper;
import com.whyc.mapper.CommonMapper;
import com.whyc.pojo.AFERectifierState;
import com.whyc.pojo.CentralMonitorSysRT;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.util.List;
@Service
public class CentralMonitorSysRTService {
    @Resource
    private CentralMonitorSysRTMapper mapper;
    @Resource
    private CentralMonitorSysRTHistoryMapper historyMapper;
    @Resource
    private CommonMapper commonMapper;
    public Response getInfoByDevId(int devId) {
        QueryWrapper<CentralMonitorSysRT> queryWrapper = new QueryWrapper<>();
@@ -26,4 +38,12 @@
            return new Response<>().setCode(0);
        }
    }
    public Response<PageInfo<CentralMonitorSysRT>> getHistory(int pageNum, int pageSize, int devId) {
        List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_central_monitor_sys_rt_" + devId);
        PageHelper.startPage(pageNum,pageSize);
        List<CentralMonitorSysRT> centralMonitorSysRTs = historyMapper.getHistory(tableNames);
        PageInfo<CentralMonitorSysRT> centralMonitorSysRTPageInfo = new PageInfo<>(centralMonitorSysRTs);
        return new Response<PageInfo<CentralMonitorSysRT>>().set(1,centralMonitorSysRTPageInfo);
    }
}