Recently found the time to roll up the project of a problem when using mybatis-plus, you need to have a place to use sql statement, so, I wrote a xml file in java catalog
written in the xml file statements, there can not run results found, note did not go in a package
such cases, there are two approaches:
1, the xml files into resources in
2, pom file as follows
<build>
<!--项目打包时会讲java目录中的*.xml文件也进行打包-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
Also in the application.yml
configuration file, of course, the path may be based on the actual
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath:com/zeny/edu/eduservice/mapper/xml/*.xml
Finally came loaded