update 重构分页 基于 分页新方法

This commit is contained in:
疯狂的狮子li
2021-12-03 15:57:58 +08:00
parent b5db6fe186
commit 5ba39c0086
44 changed files with 162 additions and 191 deletions

View File

@ -5,6 +5,7 @@ import cn.hutool.core.io.IoUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.generator.domain.GenTable;
@ -46,8 +47,8 @@ public class GenController extends BaseController {
@ApiOperation("查询代码生成列表")
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
@GetMapping("/list")
public TableDataInfo<GenTable> genList(GenTable genTable) {
return genTableService.selectPageGenTableList(genTable);
public TableDataInfo<GenTable> genList(GenTable genTable, PageQuery pageQuery) {
return genTableService.selectPageGenTableList(genTable, pageQuery);
}
/**
@ -73,8 +74,8 @@ public class GenController extends BaseController {
@ApiOperation("查询数据库列表")
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
@GetMapping("/db/list")
public TableDataInfo<GenTable> dataList(GenTable genTable) {
return genTableService.selectPageDbTableList(genTable);
public TableDataInfo<GenTable> dataList(GenTable genTable, PageQuery pageQuery) {
return genTableService.selectPageDbTableList(genTable, pageQuery);
}
/**

View File

@ -4,8 +4,10 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.GenConstants;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.ServiceException;
@ -66,13 +68,15 @@ public class GenTableServiceImpl extends ServicePlusImpl<GenTableMapper, GenTabl
}
@Override
public TableDataInfo<GenTable> selectPageGenTableList(GenTable genTable) {
return PageUtils.buildDataInfo(baseMapper.selectPageGenTableList(PageUtils.buildPage(), genTable));
public TableDataInfo<GenTable> selectPageGenTableList(GenTable genTable, PageQuery pageQuery) {
Page<GenTable> page = baseMapper.selectPageGenTableList(PageUtils.buildPage(pageQuery), genTable);
return PageUtils.buildDataInfo(page);
}
@Override
public TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable) {
return PageUtils.buildDataInfo(baseMapper.selectPageDbTableList(PageUtils.buildPage(), genTable));
public TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable, PageQuery pageQuery) {
Page<GenTable> page = baseMapper.selectPageDbTableList(PageUtils.buildPage(pageQuery), genTable);
return PageUtils.buildDataInfo(page);
}
/**

View File

@ -1,6 +1,7 @@
package com.ruoyi.generator.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.generator.domain.GenTable;
@ -15,10 +16,10 @@ import java.util.Map;
public interface IGenTableService extends IService<GenTable> {
TableDataInfo<GenTable> selectPageGenTableList(GenTable genTable);
TableDataInfo<GenTable> selectPageGenTableList(GenTable genTable, PageQuery pageQuery);
TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable);
TableDataInfo<GenTable> selectPageDbTableList(GenTable genTable, PageQuery pageQuery);
/**
* 查询业务列表