This commit is contained in:
miemie 2024-10-29 12:19:02 +08:00
parent 736064bca3
commit c44259b09a

View File

@ -41,7 +41,8 @@
## What is MyBatis-Plus? ## What is MyBatis-Plus?
MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development. This toolkit provides some efficient, useful, out-of-the-box features for MyBatis, use it can effectively save your development time. MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development. This toolkit provides some efficient,
useful, out-of-the-box features for MyBatis, use it can effectively save your development time.
## Links ## Links
@ -53,23 +54,24 @@ MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development
## Features ## Features
- Fully compatible with MyBatis - Fully compatible with MyBatis
- Auto configuration on startup - Auto configuration on startup
- Out-of-the-box interfaces for operate database - Out-of-the-box interfaces for operate database
- Powerful and flexible where condition wrapper - Powerful and flexible where condition wrapper
- Multiple strategy to generate primary key - Multiple strategy to generate primary key
- Lambda-style API - Lambda-style API
- Almighty and highly customizable code generator - Almighty and highly customizable code generator
- Automatic paging operation - Automatic paging operation
- SQL Inject defense - SQL Inject defense
- Support active record - Support active record
- Support pluggable custom interface - Support pluggable custom interface
- Build-in many useful extensions - Build-in many useful extensions
## Getting started ## Getting started
- Add MyBatis-Plus dependency - Add MyBatis-Plus dependency
- Latest Version: [![Maven Central](https://img.shields.io/maven-central/v/com.baomidou/mybatis-plus.svg)](https://search.maven.org/search?q=g:com.baomidou%20a:mybatis-*) - Latest
Version: [![Maven Central](https://img.shields.io/maven-central/v/com.baomidou/mybatis-plus.svg)](https://search.maven.org/search?q=g:com.baomidou%20a:mybatis-*)
- Maven: - Maven:
- SpringBoot2 - SpringBoot2
```xml ```xml
@ -87,6 +89,24 @@ MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development
<version>Latest Version</version> <version>Latest Version</version>
</dependency> </dependency>
``` ```
- `^3.9.6` may need additional citations
- jdk8+
```xml
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-jsqlparser</artifactId>
<version>Latest Version</version>
</dependency>
```
- jdk8
```xml
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-jsqlparser-4.9</artifactId>
<version>Latest Version</version>
</dependency>
```
- Gradle - Gradle
- SpringBoot2 - SpringBoot2
```groovy ```groovy
@ -96,13 +116,13 @@ MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development
```groovy ```groovy
compile group: 'com.baomidou', name: 'mybatis-plus-spring-boot3-starter', version: 'Latest Version' compile group: 'com.baomidou', name: 'mybatis-plus-spring-boot3-starter', version: 'Latest Version'
``` ```
- Modify mapper file extends BaseMapper interface - Modify mapper file extends BaseMapper interface
```java ```java
public interface UserMapper extends BaseMapper<User> { public interface UserMapper extends BaseMapper<User> {
} }
``` ```
- Use it - Use it
``` java ``` java
@ -112,13 +132,15 @@ MyBatis-Plus is an powerful enhanced toolkit of MyBatis for simplify development
.ge(User::getAge, 18) .ge(User::getAge, 18)
); );
``` ```
MyBatis-Plus will execute the following SQL MyBatis-Plus will execute the following SQL
```sql ```sql
SELECT * FROM user WHERE age >= 18 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](https://baomidou.com). > This showcase is just a small part of MyBatis-Plus features. If you want to learn more, please refer to
> the [documentation](https://baomidou.com).
## License ## License
MyBatis-Plus is under the Apache 2.0 license. See the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) file for details. MyBatis-Plus is under the Apache 2.0 license. See the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
file for details.