public class MysqlPageFactory extends Object implements IPageFactory
Modifier and Type | Field and Description |
---|---|
static String |
pageIndexVarName |
static String |
pageSizeVarName |
Constructor and Description |
---|
MysqlPageFactory() |
Modifier and Type | Method and Description |
---|---|
<T> IPage<T> |
assemble(List<T> data,
Long maxRows,
int pageSize,
int pageIndex)
组装成一个分页对象
|
ISQL |
countSql(ISQL template)
获取统计此分页条件西安的总记录数量的sql
|
String |
countSqlSelectName()
countSql 中返回的记录数量列名,比如select count(*)as max_row from user;中的 max_row
|
int |
getDefaultPageSize()
获取默认分页大小
|
int |
getPageIndex(ISQL template)
从参数空间中获取当前分页编号参数
|
int |
getPageSize(ISQL template)
从参数空间中获取分页大小参数
|
Integer |
pageIndex()
获取当前分页编号,分页从1开始
|
void |
pageIndex(Integer page)
设置当前页编号
|
Integer |
pageSize()
获取分页大小
|
void |
pageSize(Integer size)
设置分页大小
|
ISQL |
pageSql(ISQL template)
获取分页sql
|
void |
setDefaultPageSize(int size)
设置默认分页大小
|
public static final String pageSizeVarName
public static final String pageIndexVarName
public ISQL countSql(ISQL template)
IPageFactory
countSql
in interface IPageFactory
template
- 模版sql对象public String countSqlSelectName()
IPageFactory
countSqlSelectName
in interface IPageFactory
public ISQL pageSql(ISQL template)
IPageFactory
pageSql
in interface IPageFactory
template
- 模版sql对象public <T> IPage<T> assemble(List<T> data, Long maxRows, int pageSize, int pageIndex)
IPageFactory
assemble
in interface IPageFactory
T
- 分页对象类型data
- 分页结果maxRows
- 此分页条件下的总记录数量pageSize
- 页大小pageIndex
- 当前页public int getPageSize(ISQL template)
IPageFactory
getPageSize
in interface IPageFactory
template
- 模版SQLpublic int getPageIndex(ISQL template)
IPageFactory
getPageIndex
in interface IPageFactory
template
- 模版SQLpublic void setDefaultPageSize(int size)
IPageFactory
setDefaultPageSize
in interface IPageFactory
size
- 默认的分页大小public int getDefaultPageSize()
IPageFactory
getDefaultPageSize
in interface IPageFactory
public Integer pageSize()
IPageParam
pageSize
in interface IPageParam
public Integer pageIndex()
IPageParam
pageIndex
in interface IPageParam
public void pageSize(Integer size)
IPageParam
pageSize
in interface IPageParam
size
- 分页大小public void pageIndex(Integer page)
IPageParam
pageIndex
in interface IPageParam
page
- 当前页Copyright © 2022. All rights reserved.