|
@@ -85,8 +85,13 @@ public class PaginationInterceptor implements Interceptor {
|
|
RowBounds rowBounds = (RowBounds) metaStatementHandler.getValue("delegate.rowBounds");
|
|
RowBounds rowBounds = (RowBounds) metaStatementHandler.getValue("delegate.rowBounds");
|
|
/* 不需要分页的场合 */
|
|
/* 不需要分页的场合 */
|
|
if (rowBounds == null || rowBounds == RowBounds.DEFAULT) {
|
|
if (rowBounds == null || rowBounds == RowBounds.DEFAULT) {
|
|
- return invocation.proceed();
|
|
|
|
|
|
+ // @lt 采用ThreadLocal变量处理的分页
|
|
|
|
+ rowBounds = PageHelper.getPagination();
|
|
|
|
+ if (rowBounds == null){
|
|
|
|
+ return invocation.proceed();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ // 针对定义了rowBounds,做为mapper接口方法的参数
|
|
BoundSql boundSql = (BoundSql) metaStatementHandler.getValue("delegate.boundSql");
|
|
BoundSql boundSql = (BoundSql) metaStatementHandler.getValue("delegate.boundSql");
|
|
String originalSql = boundSql.getSql();
|
|
String originalSql = boundSql.getSql();
|
|
Connection connection = (Connection) invocation.getArgs()[0];
|
|
Connection connection = (Connection) invocation.getArgs()[0];
|