baomidou/mybatis-plus
baomidou/mybatis-plus has 17,486 GitHub stars and 4,439 forks. GitHot measured -1 stars in 24 hours. Last checked 2026-11-06 23:58 UTC. Last push 2026-11-04.
An powerful enhanced toolkit of MyBatis for simplify development
What you can do
- Fully compatible with MyBatis
- Auto configuration on startup
- Out-of-the-box interfaces for operate database
- Powerful and flexible where condition wrapper
Measured star growth
- in 24h
- -1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalBorn To Simplify Development
添加 微信 wx153666 备注进 mp 群
不允许非法项目使用,后果自负
Special user
What is MyBatis-Plus?
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
Links
Features
- Fully compatible with MyBatis
- Auto configuration on startup
- Out-of-the-box interfaces for operate database
- Powerful and flexible where condition wrapper
- Multiple strategy to generate primary key
- Lambda-style API
- Almighty and highly customizable code generator
- Automatic paging operation
- SQL Inject defense
- Support active record
- Support pluggable custom interface
- Build-in many useful extensions
Getting started
Add MyBatis-Plus dependency
Choose the starter for your Spring Boot version and replace Latest Version with the MyBatis-Plus version you want to use.
Spring Boot 4
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'
Spring Boot 3
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'
Spring Boot 2
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'
SQL parser dependency (optional)
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'
Extend the BaseMapper interface
public interface UserMapper extends BaseMapper<User> {
}
Use it
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.
License
MyBatis-Plus is under the Apache 2.0 license. See the Apache License 2.0 file for details.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,567 starspublic-apis/public-apis
A collective list of free APIs
496,835 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
439,234 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,102 stars