public class PageUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PageUtil.By |
static class |
PageUtil.Sb |
| Modifier and Type | Field and Description |
|---|---|
static char |
SORT_DELI |
static char |
SORT_DESC |
| Constructor and Description |
|---|
PageUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
dataIndex(int pageNumber,
int pageSize)
计算当前页对应记录的偏移量,pageNumber从1开始, pageSize 不小于1。
|
static PageUtil.Sb |
sort() |
static List<PageUtil.By> |
sortBy(String sortBy)
构造order-by的约定字符串。`,`分隔,`key`表示asc升序,`-key`表示desc降序。
自动移除所有空白字符,WitheUtil
|
static int |
totalPage(int totalData,
int pageSize)
把总记录数分页,totalData,pageSize不小于1。
|
public static final char SORT_DESC
public static final char SORT_DELI
public static int dataIndex(int pageNumber,
int pageSize)
pageNumber - 从1开始pageSize - 不小于1public static int totalPage(int totalData,
int pageSize)
totalData - 总记录数量,超过21亿的数字不可想象pageSize - 每页显示记录数量public static PageUtil.Sb sort()
public static List<PageUtil.By> sortBy(String sortBy)
Copyright © 2020. All rights reserved.