1、导入依赖
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
2、配置
# 导入驱动
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version>
</dependency>
# 配置数据源(nacos)
spring:
datasource:
username: root
password: root
url: jdbc:mysql:///:3306/yueji_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useSSL=false
driver-class-name: com.mysql.jdbc.Driver
3、使用mybatis-plus功能
# 等同于在xml映射接口上标记@Mapper
@MapperScan("com.yueji.product.dao")
# 告诉mybatis-plus映射文件的位置
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
# 逻辑删除配置
global-config:
db-config:
id-type: auto #主键策略自增
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
# 开启SQL日志
logging:
level:
com.yueji.product: debug
标签:useSSL,yueji,plus,com,mysql,mybatis,阅己
From: https://www.cnblogs.com/fengchong0925/p/18390224