Browse Source

pagination

miemie 5 years ago
parent
commit
db476b15b5

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

@@ -126,7 +126,7 @@ public class PaginationInnerInterceptor implements InnerInterceptor {
 
 
         CacheKey cacheKey = executor.createCacheKey(countMs, parameter, rowBounds, countSql);
         CacheKey cacheKey = executor.createCacheKey(countMs, parameter, rowBounds, countSql);
         Object result = executor.query(countMs, parameter, rowBounds, resultHandler, cacheKey, countSql).get(0);
         Object result = executor.query(countMs, parameter, rowBounds, resultHandler, cacheKey, countSql).get(0);
-        page.setTotal(Long.parseLong(result.toString()));
+        page.setTotal(result == null ? 0L : Long.parseLong(result.toString()));
         return continueLimit(page);
         return continueLimit(page);
     }
     }