Selaa lähdekoodia

新增 localPage 分页模式

= 8 vuotta sitten
vanhempi
commit
5036936e16

+ 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");