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 3ec9819c9b4ab18a6f8c605bb8e8c7f3f8c7ae01..05eb1855f4ffffc1eb53ea64b8468b3d219964a1 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); } }