Spring Boot整合Mybatis 解决 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
一.
Spring Boot与mybatis整合时默认只扫描resources目录下且与Dao同名包下的mapper.xml.
二.
如果mapper.xml放在src/java/…/Dao目录下,pom.xml 标签下需添加:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
三.
检查mapper.xml里的namesapce是否与Dao层类名一致;
检查mapper.xml里的方法id是否与Dao层的方法名一致.