浏览代码

新增 localPage 分页模式

= 8 年之前
父节点
当前提交
5036936e16
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/main/java/com/baomidou/mybatisplus/plugins/PaginationInterceptor.java

+ 5 - 3
src/main/java/com/baomidou/mybatisplus/plugins/PaginationInterceptor.java

@@ -91,10 +91,12 @@ public class PaginationInterceptor implements Interceptor {
             if (localPage) {
                 // 采用ThreadLocal变量处理的分页
                 rowBounds = PageHelper.getPagination();
+                if (rowBounds == null) {
+                    return invocation.proceed();
+                }
             }
-            if (rowBounds == null) {
-                return invocation.proceed();
-            }
+            // 无需分页
+            return invocation.proceed();
         }
         // 针对定义了rowBounds,做为mapper接口方法的参数
         BoundSql boundSql = (BoundSql) metaStatementHandler.getValue("delegate.boundSql");