From ae95667bff27f76edb9dcb8e13c3a325467fc51f Mon Sep 17 00:00:00 2001 From: zyyang Date: Sat, 14 Nov 2020 16:32:49 +0800 Subject: [PATCH] change --- .../config/MybatisPlusConfig.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/MybatisPlusConfig.java b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/MybatisPlusConfig.java index 3ec9819c9b..05eb1855f4 100644 --- a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/MybatisPlusConfig.java +++ b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/config/MybatisPlusConfig.java @@ -1,6 +1,8 @@ package com.taosdata.example.mybatisplusdemo.config; -import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -8,16 +10,15 @@ import org.springframework.context.annotation.Configuration; public class MybatisPlusConfig { @Bean - public PaginationInterceptor paginationInnerInterceptor() { - PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); - // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false - // paginationInterceptor.setOverflow(false); - // 设置最大单页限制数量,默认 500 条,-1 不受限制 - // paginationInterceptor.setLimit(500); - // 开启 count 的 join 优化,只针对部分 left join -// paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true)); - return paginationInterceptor; + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); + return interceptor; + } + @Bean + public ConfigurationCustomizer configurationCustomizer() { + return configuration -> configuration.setUseDeprecatedExecutor(false); } } -- GitLab