修改接口system/devicemodel/list分页
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.core.business.Device;
|
||||
import com.maibu.core.business.DeviceModel;import com.maibu.core.business.DeviceRunStatistics;
|
||||
@@ -11,6 +13,7 @@ import com.maibu.mapper.DeviceRunStatisticsMapper;
|
||||
import com.maibu.mybatis.LambdaQueryWrapperX;
|
||||
import com.maibu.service.IDeviceService;
|
||||
import com.maibu.service.SysDeviceModelService;
|
||||
import com.maibu.utils.ServletUtils;
|
||||
import com.maibu.utils.StringUtils;
|
||||
import com.maibu.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -73,9 +76,13 @@ public class SysDeviceModelController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备模型列表")
|
||||
public TableDataInfo list(DeviceModel deviceModel) {
|
||||
startPage();
|
||||
List<DeviceModel> list = deviceModelService.selectDeviceModelList(deviceModel);
|
||||
return getDataTable(list);
|
||||
Integer pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
|
||||
Page<DeviceModel> page = new Page<>(pageNum, pageSize);
|
||||
Page<DeviceModel> resultPage = deviceModelService.selectDeviceModelPage(page, deviceModel);
|
||||
|
||||
return getDataTable(resultPage.getRecords(), resultPage.getTotal());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.maibu.core.business.DeviceModel;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,11 +19,12 @@ public interface SysDeviceModelService {
|
||||
int insertDeviceModel(DeviceModel deviceModel);
|
||||
|
||||
/**
|
||||
*查询设备模型列表
|
||||
* @param deviceModel
|
||||
* @return
|
||||
* 分页查询设备模型列表
|
||||
* @param page 分页对象
|
||||
* @param deviceModel 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
List<DeviceModel> selectDeviceModelList(DeviceModel deviceModel);
|
||||
Page<DeviceModel> selectDeviceModelPage(Page<DeviceModel> page, DeviceModel deviceModel);
|
||||
|
||||
/**
|
||||
* selectDeviceModelById
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user