环境:
Springboot:2.1.1.RELEASE
Mybatis-plus:2.2.0
依赖:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatisplus.version}</version>
</dependency>
application.yml内关于plus的配置(参考)
mybatis-plus:
mapper-locations: classpath:mapper/*Mapper.xml
typeAliasesPackage: com.springboot.demo.entity
global-config:
id-type: 0
field-strategy: 0
db-column-underline: true
refresh-mapper: true
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
编写配置类
package com.springboot.demo.config;
import com.baomidou.