在pom文件加入:


<build>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>

</build>


在配置:

mybatis-plus.mapper-locations=classpath*:com/example/mybatisPlus/**/mapping/*Mapper.xml


mybatis-plus.type-aliases-package=com.example.mybatisPlus.model
mybatis-plus.type-enums-package=com.example.mybatisPlus.model
mybatis-plus.global-config.id-type:2
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
#字段策略 0:"忽略判断",1:"非 NULL 判断",2:"非空判断"
mybatis-plus.global-config.field-strategy: 2
#驼峰下划线转换
mybatis-plus.global-config.db-column-underline: true
#刷新mapper 调试神器
mybatis-plus.global-config.refresh-mapper: true
#数据库大写下划线转换
mybatis-plus.global-config.capital-mode: true
#逻辑删除配置(下面3个配置)
mybatis-plus.global-config.logic-delete-value: 0
mybatis-plus.global-config.logic-not-delete-value: 1
# SQL 解析缓存,开启后多租户 @SqlParser 注解生效
mybatis-plus.global-config.sql-parser-cache: true

mybatis-plus.global-config.configuration.log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.global-config.configuration.map-underscore-to-camel-case: true
mybatis-plus.global-config.configuration.cache-enabled: false
mybatis-plus.global-config.configuration.jdbc-type-for-null: 'null'