1、文件:MybatisPlusConfig.java
作用:扫描mapper接口 @MapperScan(basePackages = "com.h3c.fang.**.mapper")
2、文件: pom.xml
作用:建立mapper与mapper.xml的对应关系;
内容:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
3、mapper路径与mapper.xml路径不一致的情况
文件:application.yaml
内容:
mybatis:
mapper-locations: classpath:mybatis/*.xml