构造器和说明 |
---|
DbPluginProcessorBase() |
DbPluginProcessorBase(java.lang.String dbType) |
限定符和类型 | 方法和说明 |
---|---|
static void |
clearPageParams()
清理pageParams
|
protected java.lang.Boolean |
exclude(java.lang.String sql)
排除一些update insert delete 语句
|
java.lang.String |
getAdvSql(java.lang.String[] condition,
java.lang.String sql)
得到高级查询的语句.
|
java.lang.String |
getDbType() |
protected java.lang.String |
getPageDataSQL(java.lang.String sql,
java.lang.Object parameterObject) |
static PageParams |
getPageParams()
获取当前的pageParams
|
PageParams |
getPageParamsForParamObj(java.lang.Object parameterObject,
java.lang.String[] condition)
分离出分页参数.
|
PagingPluginEx |
getPlugin() |
protected java.lang.String |
getSortOrderForParamObj(java.lang.Object parameterObject) |
protected java.lang.String |
getTotalSQL(java.lang.String currSql,
java.lang.String dbType,
java.lang.String extSumSqlField,
java.util.Map<java.lang.String,java.lang.String> totalFields)
计算总数的SQL, 这里需要根据数据库的类型改写SQL,目前支持MySQL和Oracle
|
java.lang.Object |
intercept(org.apache.ibatis.plugin.Invocation invocation) |
protected void |
preparePageDataParams(java.sql.PreparedStatement ps,
int pageNum,
int pageSize,
java.lang.String dbType)
TODO 需要使用其他数据库需要改写
使用PreparedStatement预编译两个分页参数,如果数据库的规则不一样,需要改写设置的参数规则。
|
protected java.lang.String |
processFunctionSql(java.lang.Object parameterObject,
java.lang.String sql)
处理特殊的函数
|
java.lang.String |
processNoPageSql(java.lang.Object parameterObject,
java.lang.String sql)
处理非分页的 的参数,排序 特殊函数
|
protected java.lang.String |
processOrderField(java.lang.Object parameterObject,
java.lang.String sql)
处理排除字段参数
|
java.lang.Object |
processPageSql(org.apache.ibatis.executor.statement.StatementHandler stmtHandler,
org.apache.ibatis.reflection.MetaObject metaStatementHandler,
PageParams pageParams,
org.apache.ibatis.mapping.BoundSql boundSql)
语句处理函数
|
void |
setDbType(java.lang.String dbType) |
void |
setPlugin(PagingPluginEx plugin) |
void |
setTotal(org.apache.ibatis.plugin.Invocation invocation,
PageParams pageParams,
org.apache.ibatis.reflection.MetaObject metaStatementHandler,
org.apache.ibatis.mapping.BoundSql boundSql)
设置分页的总数
|
protected java.lang.String |
setValueWithDbType(java.lang.String adqContion,
java.lang.String dbType)
根据不同的数据库组装高级查询,针对时间类型的组装
|
public DbPluginProcessorBase()
public DbPluginProcessorBase(java.lang.String dbType)
protected java.lang.Boolean exclude(java.lang.String sql)
sql
- SQL语句public java.lang.Object intercept(org.apache.ibatis.plugin.Invocation invocation) throws java.lang.Throwable
java.lang.Throwable
public void setTotal(org.apache.ibatis.plugin.Invocation invocation, PageParams pageParams, org.apache.ibatis.reflection.MetaObject metaStatementHandler, org.apache.ibatis.mapping.BoundSql boundSql) throws java.lang.Throwable
invocation
- 调用pageParams
- 页面参数metaStatementHandler
- metaStatementHandlerboundSql
- sql对象java.lang.Throwable
- 出错抛出异常public java.lang.String getAdvSql(java.lang.String[] condition, java.lang.String sql)
condition
- 条件sql
- sql语句protected java.lang.String getTotalSQL(java.lang.String currSql, java.lang.String dbType, java.lang.String extSumSqlField, java.util.Map<java.lang.String,java.lang.String> totalFields) throws NotSupportedDbException
currSql
- —— 当前执行的SQLextSumSql
- NotSupportedDbException
protected java.lang.String setValueWithDbType(java.lang.String adqContion, java.lang.String dbType)
adqContion
- public java.lang.String processNoPageSql(java.lang.Object parameterObject, java.lang.String sql) throws java.lang.Exception
parameterObject
- 参数sql
- sql语句java.lang.Exception
- 出错会抛出异常protected java.lang.String processOrderField(java.lang.Object parameterObject, java.lang.String sql) throws java.lang.Exception
parameterObject
- 参数sql
- sql语句java.lang.Exception
protected java.lang.String processFunctionSql(java.lang.Object parameterObject, java.lang.String sql) throws java.lang.Exception
parameterObject
- 参数sql
- sql语句java.lang.Exception
- 出错会抛出异常public java.lang.Object processPageSql(org.apache.ibatis.executor.statement.StatementHandler stmtHandler, org.apache.ibatis.reflection.MetaObject metaStatementHandler, PageParams pageParams, org.apache.ibatis.mapping.BoundSql boundSql) throws java.lang.Exception
stmtHandler
- StatementHandlermetaStatementHandler
- MetaObjectpageParams
- PageParamsboundSql
- BoundSqljava.lang.Exception
- 出错会抛出异常protected void preparePageDataParams(java.sql.PreparedStatement ps, int pageNum, int pageSize, java.lang.String dbType) throws java.lang.Exception
java.sql.SQLException
- 出错抛出数据库异常NotSupportedDbException
java.lang.Exception
protected java.lang.String getPageDataSQL(java.lang.String sql, java.lang.Object parameterObject) throws java.lang.Exception
java.lang.Exception
public java.lang.String getDbType()
public void setDbType(java.lang.String dbType)
public PageParams getPageParamsForParamObj(java.lang.Object parameterObject, java.lang.String[] condition) throws java.lang.Exception
parameterObject
- --执行参数condition
- 条件java.lang.Exception
- 出错会抛出异常protected java.lang.String getSortOrderForParamObj(java.lang.Object parameterObject) throws java.beans.IntrospectionException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
parameterObject
- 参数java.beans.IntrospectionException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
public PagingPluginEx getPlugin()
public void setPlugin(PagingPluginEx plugin)
public static PageParams getPageParams()
public static void clearPageParams()