public final class PageHandler extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_LIMIT |
static String |
DEFAULT_OFFSET |
static String |
DEFAULT_PAGE_NUM |
static String |
DEFAULT_PAGE_SIZE |
static int |
MAX_SIZE |
static PageHandler |
NORMAL |
static Map<String,Object> |
QUERY_ALL_PARAMS |
| 构造器和说明 |
|---|
PageHandler(String paramPageNum,
String paramPageSize,
String paramOffset,
String paramLimit) |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
computeOffset(long pageNum,
int pageSize) |
static int |
computePageNum(long offset,
int limit) |
static int |
computeTotalPages(long totalRecords,
int pageSize) |
void |
handle(Object params)
Handles the page parameters
|
static void |
offsetPage(Integer offset,
Integer limit)
Page query with offset and limit
RowBounds.limit=0则会查询出全部的结果
|
static void |
startPage(Integer pageNum,
Integer pageSize)
Page query with pageNum and pageSize
pageSize=0时查询全部数据
|
public static final PageHandler NORMAL
public static final int MAX_SIZE
public void handle(@Nonnull Object params)
params - the paramspublic static void startPage(Integer pageNum, Integer pageSize)
pageNum - the pageNumpageSize - the pageSizepublic static void offsetPage(Integer offset, Integer limit)
offset - the offsetlimit - the limitpublic static int computeTotalPages(long totalRecords,
int pageSize)
public static int computePageNum(long offset,
int limit)
public static int computeOffset(long pageNum,
int pageSize)
Copyright © 2023. All rights reserved.