public class PageHelper extends PageMethod implements Dialect
DEFAULT_COUNT, LOCAL_PAGE
Constructor and Description |
---|
PageHelper() |
Modifier and Type | Method and Description |
---|---|
void |
afterAll()
完成所有任务后
|
boolean |
afterCount(long count,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds)
执行完 count 查询后
|
Object |
afterPage(List pageList,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds)
分页查询后,处理分页结果,拦截器中直接 return 该方法的返回值
|
boolean |
beforeCount(org.apache.ibatis.mapping.MappedStatement ms,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds)
执行分页前,返回 true 会进行 count 查询,false 会继续下面的 beforePage 判断
|
boolean |
beforePage(org.apache.ibatis.mapping.MappedStatement ms,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds)
执行分页前,返回 true 会进行分页查询,false 会返回默认查询结果
|
String |
getCountSql(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.BoundSql boundSql,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds,
org.apache.ibatis.cache.CacheKey countKey)
生成 count 查询 sql
|
String |
getPageSql(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.BoundSql boundSql,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds,
org.apache.ibatis.cache.CacheKey pageKey)
生成分页查询 sql
|
String |
getPageSql(String sql,
Page page,
org.apache.ibatis.session.RowBounds rowBounds,
org.apache.ibatis.cache.CacheKey pageKey) |
Object |
processParameterObject(org.apache.ibatis.mapping.MappedStatement ms,
Object parameterObject,
org.apache.ibatis.mapping.BoundSql boundSql,
org.apache.ibatis.cache.CacheKey pageKey)
处理查询参数对象
|
void |
setProperties(Properties properties)
设置参数
|
boolean |
skip(org.apache.ibatis.mapping.MappedStatement ms,
Object parameterObject,
org.apache.ibatis.session.RowBounds rowBounds)
跳过 count 和 分页查询
|
clearPage, count, getLocalPage, offsetPage, offsetPage, orderBy, setLocalPage, setStaticProperties, startPage, startPage, startPage, startPage, startPage
public boolean skip(org.apache.ibatis.mapping.MappedStatement ms, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds)
Dialect
public boolean beforeCount(org.apache.ibatis.mapping.MappedStatement ms, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds)
Dialect
beforeCount
in interface Dialect
ms
- MappedStatementparameterObject
- 方法参数rowBounds
- 分页参数public String getCountSql(org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.mapping.BoundSql boundSql, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.cache.CacheKey countKey)
Dialect
getCountSql
in interface Dialect
ms
- MappedStatementboundSql
- 绑定 SQL 对象parameterObject
- 方法参数rowBounds
- 分页参数countKey
- count 缓存 keypublic boolean afterCount(long count, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds)
Dialect
afterCount
in interface Dialect
count
- 查询结果总数parameterObject
- 接口参数rowBounds
- 分页参数public Object processParameterObject(org.apache.ibatis.mapping.MappedStatement ms, Object parameterObject, org.apache.ibatis.mapping.BoundSql boundSql, org.apache.ibatis.cache.CacheKey pageKey)
Dialect
processParameterObject
in interface Dialect
ms
- MappedStatementpublic boolean beforePage(org.apache.ibatis.mapping.MappedStatement ms, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds)
Dialect
beforePage
in interface Dialect
ms
- MappedStatementparameterObject
- 方法参数rowBounds
- 分页参数public String getPageSql(org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.mapping.BoundSql boundSql, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.cache.CacheKey pageKey)
Dialect
getPageSql
in interface Dialect
ms
- MappedStatementboundSql
- 绑定 SQL 对象parameterObject
- 方法参数rowBounds
- 分页参数pageKey
- 分页缓存 keypublic String getPageSql(String sql, Page page, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.cache.CacheKey pageKey)
public Object afterPage(List pageList, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds)
Dialect
public void afterAll()
Dialect
public void setProperties(Properties properties)
Dialect
setProperties
in interface Dialect
properties
- 插件属性Copyright © 2018. All rights reserved.