diff --git a/examples/mybatisplus-generator/README.md b/examples/mybatisplus-generator/README.md
new file mode 100644
index 00000000..8b01b076
--- /dev/null
+++ b/examples/mybatisplus-generator/README.md
@@ -0,0 +1,181 @@
+
+# MybatisPlus-Generator Demo
+## Introduction
+
+This demo shows how to use IoTDB-MybatisPlus-Generator
+
+### Version usage
+
+IoTDB: 2.0.1-beta
+mybatisPlus: 3.5.10
+
+### 1. Install IoTDB
+
+please refer to [https://iotdb.apache.org/#/Download](https://iotdb.apache.org/#/Download)
+
+### 2. Startup IoTDB
+
+please refer to [Quick Start](http://iotdb.apache.org/UserGuide/Master/Get%20Started/QuickStart.html)
+
+Then we need to create a database 'test' by cli in table model
+```
+create database test;
+use test;
+```
+Then we need to create a database 'table'
+```sql
+CREATE TABLE mix (
+ time TIMESTAMP TIME,
+ region STRING TAG,
+ plant_id STRING TAG,
+ device_id STRING TAG,
+ model_id STRING ATTRIBUTE,
+ maintenance STRING ATTRIBUTE,
+ temperature FLOAT FIELD,
+ humidity FLOAT FIELD,
+ status Boolean FIELD,
+ arrival_time TIMESTAMP FIELD
+) WITH (TTL=31536000000);
+```
+
+### 3. Build Dependencies with Maven in your Project
+
+```
+
+ 3.5.10
+ 17
+ 17
+ UTF-8
+ 3.4.5
+ 6.2.6
+ 2.0.4-SNAPSHOT
+ 3.0.0
+
+
+
+
+ com.baomidou
+ mybatis-plus-spring-boot3-starter
+ ${mybatisplus.version}
+
+
+ com.baomidou
+ mybatis-plus-generator
+ ${mybatisplus.version}
+
+
+
+ org.apache.iotdb
+ iotdb-jdbc
+ ${iotdb-jdbc.version}
+
+
+ org.springframework.boot
+ spring-boot-starter
+ ${spring-boot.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ ${spring-boot.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ ${spring-boot.version}
+ test
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${io-springfox.version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${io-springfox.version}
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.36
+
+
+ com.github.jeffreyning
+ mybatisplus-plus
+ 1.7.5-RELEASE
+
+
+```
+
+### 4. Start the Main.java
+
+### 5. the target file location
+
+You can see the target file in your Project
+```
+org/apache/iotdb/controller/MixController.java
+org/apache/iotdb/entity/Mix.java
+org/apache/iotdb/mapper/MixMapper.xml
+org/apache/iotdb/service/MixService.java
+org/apache/iotdb/service/MixServiceImpl.java
+org/apache/iotdb/MixMapper.xml
+
+```
+
+### 6. add & alter Annotations
+
+The generated code files `entity/Table1.java` and `entity/Table2.java` need to be manually adjusted to support multi-primary key queries.
+
+```java
+// add import
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
+
+// add @MppMultiId
+@MppMultiId
+// alter @TableId() -->> @TableField()
+@TableField("time")
+private Date time;
+
+// add @MppMultiId
+@MppMultiId
+// alter @TableId() -->> @TableField()
+@TableField("region")
+private String region;
+
+// add @MppMultiId
+@MppMultiId
+// alter @TableId() -->> @TableField()
+@TableField("plant_id")
+private String plantId;
+
+// add @MppMultiId
+@MppMultiId
+// alter @TableId() -->> @TableField()
+@TableField("device_id")
+private String deviceId;
+//
+
+```
+
diff --git a/examples/mybatisplus-generator/pom.xml b/examples/mybatisplus-generator/pom.xml
index 6c754799..859a3af6 100644
--- a/examples/mybatisplus-generator/pom.xml
+++ b/examples/mybatisplus-generator/pom.xml
@@ -21,16 +21,19 @@
-->
4.0.0
+
org.apache.iotdb
iotdb-extras-parent
2.0.4-SNAPSHOT
../../pom.xml
+
org.apache.iotdb
mybatisplus-generator-example
IoTDB: Example: Mybatis Plus Generator
2.0.4-SNAPHOT
+
3.5.10
17
@@ -38,13 +41,11 @@
UTF-8
3.4.5
6.2.6
+ 2.0.4-SNAPSHOT
+ 3.0.0
+
-
- org.mybatis
- mybatis
- 3.5.19
-
com.baomidou
mybatis-plus-spring-boot3-starter
@@ -53,17 +54,13 @@
com.baomidou
mybatis-plus-generator
- 3.5.10
-
-
- org.apache.velocity
- velocity-engine-core
- 2.4.1
+ ${mybatisplus.version}
+
org.apache.iotdb
iotdb-jdbc
- ${iotdb.version}
+ ${iotdb-jdbc.version}
org.springframework.boot
@@ -76,44 +73,55 @@
${spring-boot.version}
- org.springdoc
- springdoc-openapi-starter-webmvc-ui
- 2.8.6
+ org.springframework.boot
+ spring-boot-starter-test
+ ${spring-boot.version}
+ test
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${io-springfox.version}
+
+ io.springfox
+ springfox-swagger-ui
+ ${io-springfox.version}
+
+
org.projectlombok
lombok
1.18.36
+
+ com.github.jeffreyning
+ mybatisplus-plus
+ 1.7.5-RELEASE
+
+
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
-
- org.apache.iotdb:isession
-
-
-
- com.baomidou:mybatis-plus-spring-boot3-starter
- org.apache.velocity:velocity-engine-core
- org.springframework.boot:spring-boot-starter
- org.springframework.boot:spring-boot-starter-web
- org.springdoc:springdoc-openapi-starter-webmvc-ui
- org.projectlombok:lombok
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
+ org.mybatis.generator
+ mybatis-generator-maven-plugin
+ 1.4.2
+
+
+ org.apache.iotdb
+ mybatis-generator-plugin
+ 2.0.2-SNAPSHOT
+
+
- true
+ true
+ true
+ src/main/resources/generatorConfig.xml
+
diff --git a/examples/mybatisplus-generator/readme.md b/examples/mybatisplus-generator/readme.md
deleted file mode 100644
index 4ed72118..00000000
--- a/examples/mybatisplus-generator/readme.md
+++ /dev/null
@@ -1,128 +0,0 @@
-
-# MybatisPlus-Generator Demo
-## Introduction
-
- This demo shows how to use IoTDB-MybatisPlus-Generator
-
-### Version usage
-
- IoTDB: 2.0.1-beta
- mybatisPlus: 3.5.10
-
-### 1. Install IoTDB
-
- please refer to [https://iotdb.apache.org/#/Download](https://iotdb.apache.org/#/Download)
-
-### 2. Startup IoTDB
-
- please refer to [Quick Start](http://iotdb.apache.org/UserGuide/Master/Get%20Started/QuickStart.html)
-
- Then we need to create a database 'test' by cli in table model
- ```
- create database test;
- use test;
- ```
- Then we need to create a database 'table'
- ```
- CREATE TABLE mix (
- time TIMESTAMP TIME,
- region STRING TAG,
- plant_id STRING TAG,
- device_id STRING TAG,
- model_id STRING ATTRIBUTE,
- maintenance STRING ATTRIBUTE,
- temperature FLOAT FIELD,
- humidity FLOAT FIELD,
- status Boolean FIELD,
- arrival_time TIMESTAMP FIELD
- ) WITH (TTL=31536000000);
- ```
-
-### 3. Build Dependencies with Maven in your Project
-
- ```
-
-
- com.baomidou
- mybatis-plus-spring-boot3-starter
- 3.5.10
-
-
-
- com.baomidou
- mybatis-plus-generator
- 3.5.10
-
-
-
- org.apache.velocity
- velocity-engine-core
- 2.0
-
-
-
- org.apache.iotdb
- iotdb-jdbc
- 2.0.2
-
-
- org.springframework.boot
- spring-boot-starter
- 3.4.3
-
-
- org.springframework.boot
- spring-boot-starter-web
- 3.4.3
-
-
- io.springfox
- springfox-swagger2
- 3.0.0
-
-
- io.springfox
- springfox-swagger-ui
- 3.0.0
-
-
- org.projectlombok
- lombok
- 1.18.36
-
-
- ```
-
-### 5. Start the Main.java
-
-### 6、the target file location
-
- You can see the target file in your Project
- ```
- org/apache/iotdb/controller/MixController.java
- org/apache/iotdb/entity/Mix.java
- org/apache/iotdb/mapper/MixMapper.xml
- org/apache/iotdb/service/MixService.java
- org/apache/iotdb/service/MixServiceImpl.java
- org/apache/iotdb/MixMapper.xml
-
- ```
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
index bb98fbdb..6d836872 100644
--- a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/Main.java
@@ -19,21 +19,26 @@
package org.apache.iotdb;
-import org.apache.iotdb.jdbc.IoTDBDataSource;
-
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
+import org.apache.iotdb.jdbc.IoTDBDataSource;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.sql.Types;
import java.util.Collections;
+@SpringBootApplication
+@MapperScan("org.apache.iotdb.mapper")
public class Main {
public static void main(String[] args) {
+ SpringApplication.run(Main.class, args);
IoTDBDataSource dataSource = new IoTDBDataSource();
- dataSource.setUrl("jdbc:iotdb://127.0.0.1:6667/test?sql_dialect=table");
+ dataSource.setUrl("jdbc:iotdb://127.0.0.1:6667/database1?sql_dialect=table");
dataSource.setUser("root");
dataSource.setPassword("root");
FastAutoGenerator generator =
@@ -47,7 +52,7 @@ public static void main(String[] args) {
.author("IoTDB")
.enableSwagger()
.dateType(DateType.ONLY_DATE)
- .outputDir("/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/");
+ .outputDir("src/main/java");
})
.packageConfig(
builder -> {
@@ -56,8 +61,7 @@ public static void main(String[] args) {
.mapper("mapper")
.pathInfo(
Collections.singletonMap(
- OutputFile.xml,
- "/apache/iotdb-extras/examples/mybatisplus-generator/src/main/java/"));
+ OutputFile.xml, "src/main/java/org/apache/iotdb/xml"));
})
.dataSourceConfig(
builder -> {
@@ -74,11 +78,27 @@ public static void main(String[] args) {
})
.strategyConfig(
builder -> {
- builder.addInclude("mix");
+ builder.addInclude("table1");
+ builder
+ .entityBuilder()
+ .enableLombok()
+ // .addIgnoreColumns("create_time")
+ .enableFileOverride();
+ builder
+ .serviceBuilder()
+ .formatServiceFileName("%sService")
+ .formatServiceImplFileName("%sServiceImpl")
+ .convertServiceFileName((entityName -> entityName + "Service"))
+ .enableFileOverride();
+ builder.controllerBuilder().enableRestStyle().enableFileOverride();
+ })
+ .strategyConfig(
+ builder -> {
+ builder.addInclude("table2");
builder
.entityBuilder()
.enableLombok()
- .addIgnoreColumns("create_time")
+ // .addIgnoreColumns("create_time")
.enableFileOverride();
builder
.serviceBuilder()
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table1Controller.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table1Controller.java
new file mode 100644
index 00000000..be29a047
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table1Controller.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *
+ * 前端控制器
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@RestController
+@RequestMapping("/table1")
+public class Table1Controller {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table2Controller.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table2Controller.java
new file mode 100644
index 00000000..2db29da2
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/controller/Table2Controller.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *
+ * 前端控制器
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@RestController
+@RequestMapping("/table2")
+public class Table2Controller {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table1.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table1.java
new file mode 100644
index 00000000..04cc32af
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table1.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ *
+ *
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@Getter
+@Setter
+@ToString
+@ApiModel(value = "Table1对象", description = "")
+public class Table1 implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @MppMultiId
+ @TableField("time")
+ private Date time;
+
+ @MppMultiId
+ @TableField("region")
+ private String region;
+
+ @MppMultiId
+ @TableField("plant_id")
+ private String plantId;
+
+ @MppMultiId
+ @TableField("device_id")
+ private String deviceId;
+
+ private String modelId;
+
+ private String maintenance;
+
+ private Float temperature;
+
+ private Float humidity;
+
+ private Boolean status;
+
+ private Date arrivalTime;
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table2.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table2.java
new file mode 100644
index 00000000..1f77f6e5
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/entity/Table2.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ *
+ *
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@Getter
+@Setter
+@ToString
+@ApiModel(value = "Table2对象", description = "")
+public class Table2 implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @MppMultiId
+ @TableField("time")
+ private Date time;
+
+ @MppMultiId
+ @TableField("region")
+ private String region;
+
+ @MppMultiId
+ @TableField("plant_id")
+ private String plantId;
+
+ @MppMultiId
+ @TableField("device_id")
+ private String deviceId;
+
+ private String modelId;
+
+ private String maintenance;
+
+ private Float temperature;
+
+ private Float humidity;
+
+ private Boolean status;
+
+ private Date arrivalTime;
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table1Mapper.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table1Mapper.java
new file mode 100644
index 00000000..a5ca7618
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table1Mapper.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.mapper;
+
+import org.apache.iotdb.entity.Table1;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+
+/**
+ *
+ * Mapper 接口
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+public interface Table1Mapper extends BaseMapper {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table2Mapper.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table2Mapper.java
new file mode 100644
index 00000000..faf822bc
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/mapper/Table2Mapper.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.mapper;
+
+import org.apache.iotdb.entity.Table2;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+
+/**
+ *
+ * Mapper 接口
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+public interface Table2Mapper extends BaseMapper {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table1Service.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table1Service.java
new file mode 100644
index 00000000..cdfa50b4
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table1Service.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.service;
+
+import org.apache.iotdb.entity.Table1;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 服务类
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+public interface Table1Service extends IService {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table2Service.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table2Service.java
new file mode 100644
index 00000000..2ec735bd
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/Table2Service.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.service;
+
+import org.apache.iotdb.entity.Table2;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 服务类
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+public interface Table2Service extends IService {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table1ServiceImpl.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table1ServiceImpl.java
new file mode 100644
index 00000000..d712f15a
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table1ServiceImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.service.impl;
+
+import org.apache.iotdb.entity.Table1;
+import org.apache.iotdb.mapper.Table1Mapper;
+import org.apache.iotdb.service.Table1Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ * 服务实现类
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@Service
+public class Table1ServiceImpl extends ServiceImpl implements Table1Service {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table2ServiceImpl.java b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table2ServiceImpl.java
new file mode 100644
index 00000000..b9bff35c
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/service/impl/Table2ServiceImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.service.impl;
+
+import org.apache.iotdb.entity.Table2;
+import org.apache.iotdb.mapper.Table2Mapper;
+import org.apache.iotdb.service.Table2Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ * 服务实现类
+ *
+ *
+ * @author IoTDB
+ * @since 2025-06-24
+ */
+@Service
+public class Table2ServiceImpl extends ServiceImpl implements Table2Service {
+
+}
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table1Mapper.xml b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table1Mapper.xml
new file mode 100644
index 00000000..7e073ed5
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table1Mapper.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table2Mapper.xml b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table2Mapper.xml
new file mode 100644
index 00000000..5a8a6e32
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/java/org/apache/iotdb/xml/Table2Mapper.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/examples/mybatisplus-generator/src/main/resources/application.yml b/examples/mybatisplus-generator/src/main/resources/application.yml
new file mode 100644
index 00000000..bdf355a3
--- /dev/null
+++ b/examples/mybatisplus-generator/src/main/resources/application.yml
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+spring:
+ datasource:
+ url: jdbc:iotdb://127.0.0.1:6667/database1?sql_dialect=table
+ username: root
+ password: root
+ driver-class-name: org.apache.iotdb.jdbc.IoTDBDriver
diff --git a/examples/mybatisplus-generator/src/test/java/org/apache/iotdb/ApplicationTest.java b/examples/mybatisplus-generator/src/test/java/org/apache/iotdb/ApplicationTest.java
new file mode 100644
index 00000000..b368f3b0
--- /dev/null
+++ b/examples/mybatisplus-generator/src/test/java/org/apache/iotdb/ApplicationTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb;
+
+import org.apache.iotdb.service.Table1Service;
+import org.apache.iotdb.service.Table2Service;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+public class ApplicationTest {
+ @Autowired private Table1Service table1Service;
+ @Autowired private Table2Service table2Service;
+
+ @Test
+ void contextLoads() {
+ // 启动Spring容器,验证主流程无异常
+ System.out.println("Table1 查询结果:" + table1Service.list());
+ System.out.println("Table2 查询结果:" + table2Service.list());
+ }
+}