RuoYi
3 years ago
2 changed files with 31 additions and 14 deletions
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.common.core.utils; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.ruoyi.common.core.utils.sql.SqlUtil; |
||||
import com.ruoyi.common.core.web.page.PageDomain; |
||||
import com.ruoyi.common.core.web.page.TableSupport; |
||||
|
||||
/** |
||||
* 分页工具类 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class PageUtils extends PageHelper |
||||
{ |
||||
/** |
||||
* 设置请求分页数据 |
||||
*/ |
||||
public static void startPage() |
||||
{ |
||||
PageDomain pageDomain = TableSupport.buildPageRequest(); |
||||
Integer pageNum = pageDomain.getPageNum(); |
||||
Integer pageSize = pageDomain.getPageSize(); |
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) |
||||
{ |
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); |
||||
PageHelper.startPage(pageNum, pageSize, orderBy); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue