thewindminer 代码提交
This commit is contained in:
36
src/main/java/com/jxy/windminer/common/utils/PageUtils.java
Normal file
36
src/main/java/com/jxy/windminer/common/utils/PageUtils.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.jxy.windminer.common.utils;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.jxy.windminer.common.utils.sql.SqlUtil;
|
||||
import com.jxy.windminer.common.web.page.Page;
|
||||
import com.jxy.windminer.common.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* @Description 分页工具类
|
||||
* @Date 2022/5/10 14:37
|
||||
* @Author 杜懿
|
||||
*/
|
||||
public class PageUtils extends PageHelper
|
||||
{
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
public static void startPage()
|
||||
{
|
||||
Page page = TableSupport.buildPageRequest();
|
||||
Integer pageNum = page.getPageNum();
|
||||
Integer pageSize = page.getPageSize();
|
||||
String orderBy = SqlUtil.escapeOrderBySql(page.getOrderBy());
|
||||
Boolean reasonable = page.getReasonable();
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理分页的线程变量
|
||||
*/
|
||||
public static void clearPage()
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user