public abstract class AbstractHelperDialect extends AbstractDialect implements Constant
countSqlParser
PAGEPARAMETER_FIRST, PAGEPARAMETER_SECOND, SUFFIX_COUNT, SUFFIX_PAGE
Constructor and Description |
---|
AbstractHelperDialect() |
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
|
<T> Page<T> |
getLocalPage()
获取分页参数
|
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
|
abstract String |
getPageSql(String sql,
Page page,
org.apache.ibatis.cache.CacheKey pageKey)
单独处理分页部分
|
protected void |
handleParameter(org.apache.ibatis.mapping.BoundSql boundSql,
org.apache.ibatis.mapping.MappedStatement ms) |
abstract Object |
processPageParameter(org.apache.ibatis.mapping.MappedStatement ms,
Map<String,Object> paramMap,
Page page,
org.apache.ibatis.mapping.BoundSql boundSql,
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 和 分页查询
|
public <T> Page<T> getLocalPage()
T
- public final 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
getCountSql
in class AbstractDialect
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 abstract Object processPageParameter(org.apache.ibatis.mapping.MappedStatement ms, Map<String,Object> paramMap, Page page, org.apache.ibatis.mapping.BoundSql boundSql, org.apache.ibatis.cache.CacheKey pageKey)
ms
- paramMap
- page
- boundSql
- pageKey
- public 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 abstract String getPageSql(String sql, Page page, org.apache.ibatis.cache.CacheKey pageKey)
sql
- page
- 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
- 插件属性protected void handleParameter(org.apache.ibatis.mapping.BoundSql boundSql, org.apache.ibatis.mapping.MappedStatement ms)
Copyright © 2018. All rights reserved.