| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.WaterCommHistoryMapper; |
| | | import com.whyc.mapper.WaterCommMapper; |
| | | import com.whyc.pojo.UPSComm; |
| | | import com.whyc.pojo.WaterComm; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private WaterCommMapper mapper; |
| | | |
| | | @Resource |
| | | private WaterCommHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response<List<WaterComm>> getAll() { |
| | | try { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<WaterComm>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_water_comm_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<WaterComm> waterComms = historyMapper.getHistory(tableNames); |
| | | PageInfo<WaterComm> waterCommPageInfo = new PageInfo<>(waterComms); |
| | | return new Response<PageInfo<WaterComm>>().set(1,waterCommPageInfo); |
| | | } |
| | | } |