Born To Simplify Development
添加 微信 wx153666 备注进 mp 群
不允许非法项目使用,后果自负
MyBatis-Plus is a powerful and enhanced toolkit of MyBatis for simplifying development. It provides efficient, and out-of-the-box features (such as code generation, conditional query builders, pagination plugins...), effectively saving development time
Choose the starter for your Spring Boot version and replace Latest Version with the MyBatis-Plus version you want to use.
Requires MyBatis-Plus 3.5.13 or later.
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
<version>Latest Version</version>
</dependency>
Gradle:
implementation 'com.baomidou:mybatis-plus-spring-boot4-starter:Latest Version'
Test dependency (optional)
To write tests with @MybatisPlusTest, add the matching test starter using the same version as the starter above.
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot4-starter-test</artifactId>
<version>Latest Version</version>
<scope>test</scope>
</dependency>
Gradle:
testImplementation 'com.baomidou:mybatis-plus-spring-boot4-starter-test:Latest Version'
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>Latest Version</version>
</dependency>
Gradle:
implementation 'com.baomidou:mybatis-plus-spring-boot3-starter:Latest Version'
Test dependency (optional)
To write tests with @MybatisPlusTest, add the matching test starter using the same version as the starter above.
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter-test</artifactId>
<version>Latest Version</version>
<scope>test</scope>
</dependency>
Gradle:
testImplementation 'com.baomidou:mybatis-plus-spring-boot3-starter-test:Latest Version'
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>Latest Version</version>
</dependency>
Gradle:
implementation 'com.baomidou:mybatis-plus-boot-starter:Latest Version'
Test dependency (optional)
To write tests with @MybatisPlusTest, add the matching test starter using the same version as the starter above.
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter-test</artifactId>
<version>Latest Version</version>
<scope>test</scope>
</dependency>
Gradle:
testImplementation 'com.baomidou:mybatis-plus-boot-starter-test:Latest Version'
Since MyBatis-Plus 3.5.9, plugins that parse SQL, such as the pagination plugin, require one of the following parser modules. Choose one module matching your JDK and required JSqlParser version, and use the same MyBatis-Plus version as the starter.
The JSqlParser versions below reflect the dependency configuration in the current repository. For other MyBatis-Plus releases, refer to the dependencies of that release.
| MyBatis-Plus module | JSqlParser version | JDK requirement |
|---|---|---|
mybatis-plus-jsqlparser |
5.4 | JDK 11+ |
mybatis-plus-jsqlparser-5.2 |
5.2 | JDK 11+ |
mybatis-plus-jsqlparser-5.0 |
5.0 | JDK 11+ |
mybatis-plus-jsqlparser-4.9 |
4.9 | JDK 8+ |
The following example uses mybatis-plus-jsqlparser. For another JSqlParser version, replace the module name with the corresponding module from the table above.
Maven:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-jsqlparser</artifactId>
<version>Latest Version</version>
</dependency>
Gradle:
implementation 'com.baomidou:mybatis-plus-jsqlparser:Latest Version'
public interface UserMapper extends BaseMapper<User> {
}
List<User> userList = userMapper.selectList(
new QueryWrapper<User>()
.lambda()
.ge(User::getAge, 18)
);
MyBatis-Plus will execute the following SQL:
SELECT * FROM user WHERE age >= 18
This showcase is just a small part of MyBatis-Plus features. If you want to learn more, please refer to the documentation.
MyBatis-Plus is under the Apache 2.0 license. See the Apache License 2.0 file for details.
| 日期 | 榜单 | 排名 | 周期新增 | 总 STAR |
|---|