springboot报错Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

先在在编译后,到接口所在目录看一看,很有可能是没有生产对应的xml文件,因为maven默认是不编译的,所以,你需要在你的pom.xml的<build></build>里面,加上一下内容:

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

不行的话   以下逐条排查

1、mapper接口和mapper.xml是否在同一个包(package)下?名字是否一样(仅后缀不同)?

2、mapper.xml的命名空间(namespace)是否跟mapper接口的包名一致?

3、接口的方法名,与xml中的一条sql标签的id一致

4、配置文件中的配置

#mybatis
mybatis-plus:
mapper-locations: classpath:**/*Mapper.xml
原文地址:https://www.cnblogs.com/shuai666/p/14490674.html