Browse Source

fixed github issues/3599

hubin 4 years ago
parent
commit
16bb3b5122

+ 1 - 1
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/PaginationInnerInterceptor.java

@@ -449,7 +449,7 @@ public class PaginationInnerInterceptor implements InnerInterceptor {
      */
     protected void handlerLimit(IPage<?> page, Long limit) {
         final long size = page.getSize();
-        if (limit != null && limit > 0 && size > limit) {
+        if (limit != null && limit > 0 && (size > limit || size < 0)) {
             page.setSize(limit);
         }
     }