|
@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.extension.toolkit.JdbcUtils;
|
|
import com.baomidou.mybatisplus.extension.toolkit.PropertyMapper;
|
|
import com.baomidou.mybatisplus.extension.toolkit.PropertyMapper;
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils;
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
+import lombok.NoArgsConstructor;
|
|
import net.sf.jsqlparser.JSQLParserException;
|
|
import net.sf.jsqlparser.JSQLParserException;
|
|
import net.sf.jsqlparser.expression.Alias;
|
|
import net.sf.jsqlparser.expression.Alias;
|
|
import net.sf.jsqlparser.expression.Expression;
|
|
import net.sf.jsqlparser.expression.Expression;
|
|
@@ -62,6 +63,7 @@ import java.util.stream.Collectors;
|
|
* @since 2020-06-16
|
|
* @since 2020-06-16
|
|
*/
|
|
*/
|
|
@Data
|
|
@Data
|
|
|
|
+@NoArgsConstructor
|
|
@SuppressWarnings({"rawtypes"})
|
|
@SuppressWarnings({"rawtypes"})
|
|
public class PaginationInnerInterceptor implements InnerInterceptor {
|
|
public class PaginationInnerInterceptor implements InnerInterceptor {
|
|
|
|
|
|
@@ -83,7 +85,7 @@ public class PaginationInnerInterceptor implements InnerInterceptor {
|
|
/**
|
|
/**
|
|
* 溢出总页数后是否进行处理
|
|
* 溢出总页数后是否进行处理
|
|
*/
|
|
*/
|
|
- protected boolean overflow = true;
|
|
|
|
|
|
+ protected boolean overflow;
|
|
/**
|
|
/**
|
|
* 单页分页条数限制
|
|
* 单页分页条数限制
|
|
*/
|
|
*/
|
|
@@ -101,6 +103,14 @@ public class PaginationInnerInterceptor implements InnerInterceptor {
|
|
*/
|
|
*/
|
|
private IDialect dialect;
|
|
private IDialect dialect;
|
|
|
|
|
|
|
|
+ public PaginationInnerInterceptor(DbType dbType) {
|
|
|
|
+ this.dbType = dbType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public PaginationInnerInterceptor(IDialect dialect) {
|
|
|
|
+ this.dialect = dialect;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 这里进行count,如果count为0这返回false(就是不再执行sql了)
|
|
* 这里进行count,如果count为0这返回false(就是不再执行sql了)
|
|
*/
|
|
*/
|