中国算力平台算力登记系统2.0
yanzhaofeige
3 days ago 7c91ba68decae833c328ffabdf31ba9988cca2b7
commit | author | age
43dc29 1 package com.odcc.cpzidc.common.utils;
Y 2
3 import com.github.pagehelper.PageHelper;
4 import com.odcc.cpzidc.common.core.page.PageDomain;
5 import com.odcc.cpzidc.common.core.page.TableSupport;
6 import com.odcc.cpzidc.common.utils.sql.SqlUtil;
7
8 /**
9  * 分页工具类
10  * 
11  * @author ruoyi
12  */
13 public class PageUtils extends PageHelper
14 {
15     /**
16      * 设置请求分页数据
17      */
18     public static void startPage()
19     {
20         PageDomain pageDomain = TableSupport.buildPageRequest();
21         Integer pageNum = pageDomain.getPageNum();
22         Integer pageSize = pageDomain.getPageSize();
23         String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
24         Boolean reasonable = pageDomain.getReasonable();
25         PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
26     }
27
28     /**
29      * 清理分页的线程变量
30      */
31     public static void clearPage()
32     {
33         PageHelper.clearPage();
34     }
35 }