从原理出发,很多问题都很好解决。注意这3个文件的配置,一般都能配好
Application.java
1
| @MapperScan("com.ifkal.demo.**.mapper")
|
application.yml
1 2 3
| mybatis-plus: type-aliases-package: com.ifkal.demo.**.entity mapper-locations: classpath:com/ifkal/demo/**/mapper/xml/*.xml
|
pom.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <build> <resources> <resource> <directory>${basedir}/src/main/java</directory> <includes> <include>**/*.xml</include> <include>**/*.yml</include> <include>**/*.properties</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>${basedir}/src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.yml</include> <include>**/*.properties</include> </includes> <filtering>true</filtering> </resource> </resources> </build>
|