diff --git a/tests/examples/JDBC/mybatisplus-demo/pom.xml b/tests/examples/JDBC/mybatisplus-demo/pom.xml
index 54d4d824390b88aae5341100f18dd54d6ec1afc6..8535f3b797dcf13bd47d968f735ba5e7873fad51 100644
--- a/tests/examples/JDBC/mybatisplus-demo/pom.xml
+++ b/tests/examples/JDBC/mybatisplus-demo/pom.xml
@@ -31,7 +31,7 @@
com.baomidou
mybatis-plus-boot-starter
- 3.4.1
+ 3.1.2
com.h2database
@@ -97,22 +97,5 @@
-
-
- dev
-
- dev
-
-
-
- prod
-
- prod
-
-
- true
-
-
-
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 05eb1855f4ffffc1eb53ea64b8468b3d219964a1..e915bc54ec75a2e3d3aed2e495e4cb37343ae9a8 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,24 +1,27 @@
package com.taosdata.example.mybatisplusdemo.config;
-import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
-import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
- @Bean
- public MybatisPlusInterceptor mybatisPlusInterceptor() {
- MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
- interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
- return interceptor;
- }
+// @Bean
+// public MybatisPlusInterceptor mybatisPlusInterceptor() {
+// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+// interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
+// return interceptor;
+// }
+
+// @Bean
+// public ConfigurationCustomizer configurationCustomizer() {
+// return configuration -> configuration.setUseDeprecatedExecutor(false);
+// }
@Bean
- public ConfigurationCustomizer configurationCustomizer() {
- return configuration -> configuration.setUseDeprecatedExecutor(false);
+ public PaginationInterceptor paginationInterceptor() {
+ return new PaginationInterceptor();
}
}
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/controller/WeatherController.java b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/controller/WeatherController.java
index 24200c088d0aa5725a73840c337843821c2b6c40..46a188f6aaab92071514dbfd83881f69d58c02cb 100644
--- a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/controller/WeatherController.java
+++ b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/controller/WeatherController.java
@@ -1,5 +1,6 @@
package com.taosdata.example.mybatisplusdemo.controller;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taosdata.example.mybatisplusdemo.domain.Weather;
import com.taosdata.example.mybatisplusdemo.mapper.WeatherMapper;
@@ -21,12 +22,15 @@ public class WeatherController {
public List findAll() {
Integer total = mapper.selectCount(null);
final int pageSize = 3;
- Page page = new Page<>(1, pageSize);
- Page currentPage = mapper.selectPage(page, null);
+ IPage page = new Page<>(1, pageSize);
+
+ IPage currentPage = mapper.selectPage(page, null);
+
System.out.println("total : " + currentPage.getTotal());
System.out.println("pages : " + currentPage.getPages());
- System.out.println("countId : " + currentPage.getCountId());
- System.out.println("maxLimit: " + currentPage.getMaxLimit());
+
+// System.out.println("countId : " + currentPage.getCountId());
+// System.out.println("maxLimit: " + currentPage.getMaxLimit());
return currentPage.getRecords();
}
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapper.java b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapper.java
index ef1501c8847b33261bd336401fe6214a5fe8f477..0fb32d687c7ea8e7c19a95ba5cb1c9c1d23d2c75 100644
--- a/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapper.java
+++ b/tests/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapper.java
@@ -2,6 +2,7 @@ package com.taosdata.example.mybatisplusdemo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.taosdata.example.mybatisplusdemo.domain.Weather;
public interface WeatherMapper extends BaseMapper {
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-dev.yml b/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-dev.yml
deleted file mode 100644
index bc60de586063621fc36952ea0688489dda8717da..0000000000000000000000000000000000000000
--- a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-dev.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-spring:
- datasource:
- driver-class-name: org.h2.Driver
- schema: classpath:db/schema-taos.sql
- data: classpath:db/data-taos.sql
- url: jdbc:h2:mem:test
- user: root
- password: test
\ No newline at end of file
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-prod.yml b/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-prod.yml
deleted file mode 100644
index af688b76f4c637a8642edd4d1e72b671cd2dc894..0000000000000000000000000000000000000000
--- a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application-prod.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-spring:
- datasource:
- # driver-class-name: com.taosdata.jdbc.TSDBDriver
- # url: jdbc:TAOS://localhost:6030/mp_test
- # user: root
- # password: taosdata
- # charset: UTF-8
- # locale: en_US.UTF-8
- # timezone: UTC-8
- driver-class-name: com.mysql.jdbc.Driver
- url: jdbc:mysql://master:3306/test?useSSL=false
- username: root
- password: 123456
-
-logging:
- level:
- com:
- taosdata:
- example:
- mybatisplusdemo:
- mapper: debug
-
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application.yml b/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application.yml
index fdd1c39ecaf4bfb9435866f02523c56bada58a5e..af688b76f4c637a8642edd4d1e72b671cd2dc894 100644
--- a/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application.yml
+++ b/tests/examples/JDBC/mybatisplus-demo/src/main/resources/application.yml
@@ -1,3 +1,22 @@
spring:
- profiles:
- active: "@spring.profiles.active@"
\ No newline at end of file
+ datasource:
+ # driver-class-name: com.taosdata.jdbc.TSDBDriver
+ # url: jdbc:TAOS://localhost:6030/mp_test
+ # user: root
+ # password: taosdata
+ # charset: UTF-8
+ # locale: en_US.UTF-8
+ # timezone: UTC-8
+ driver-class-name: com.mysql.jdbc.Driver
+ url: jdbc:mysql://master:3306/test?useSSL=false
+ username: root
+ password: 123456
+
+logging:
+ level:
+ com:
+ taosdata:
+ example:
+ mybatisplusdemo:
+ mapper: debug
+
diff --git a/tests/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapperTest.java b/tests/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapperTest.java
index b7787d547708337764faeb0defe70b072cc2466b..59683a66386f2339202d06c7b56a7d6998834178 100644
--- a/tests/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapperTest.java
+++ b/tests/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata/example/mybatisplusdemo/mapper/WeatherMapperTest.java
@@ -1,6 +1,7 @@
package com.taosdata.example.mybatisplusdemo.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taosdata.example.mybatisplusdemo.domain.Weather;
import org.junit.Assert;
@@ -77,8 +78,13 @@ public class WeatherMapperTest {
@Test
public void testSelectPage() {
- Page page = new Page<>(1, 2);
- Page weatherPage = mapper.selectPage(page, null);
+// Page page = new Page<>(1, 2);
+
+ IPage page = new Page(1, 2);
+
+ IPage weatherPage = mapper.selectPage(page, null);
+// Page weatherPage = mapper.selectPage(page, null);
+
System.out.println("total : " + weatherPage.getTotal());
System.out.println("pages : " + weatherPage.getPages());
for (Weather weather : weatherPage.getRecords()) {