- pom.xml依赖
- application.yml配置
- 配置逻辑删除(需要主要mybaitsplus版本需要高于3.3.0否则无法配置logic-delete-field属性)
- 生成代码
pom.xml配置
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.3.1</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.3.0</version>
</dependency>
application.yml配置
mybatis-plus:
mapper-locations: com.wtest.mapper.ext/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-field: isDelete
logic-not-delete-value: 0
logic-delete-value: 1