错误: Invalid bound statement (not found): com.hanfei.Auth.mapper.SysMenuMapper.findMenuListByUserId
原因:出现这种错误,一般情况下是xml文件出错。
第一种情况:.xml文件未按要求格式书写
检查自己的xml文件,看看是不是写错了
第二种情况:如果使用maven则要注意Maven默认加载src-java-main 目录下的.java文件 ,xml在main目录下导致没有被加载。
解决办法:
1,把xml文件移到resources中。
2,在pom.xml文件下添加如下配置
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes> <include>**/*.yml</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
并在配置文件中告诉你的.xml文件所在位置
以下是在springboot框架下的,yml配置文件中的配置。
mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl mapper-locations: classpath:com/hanfei/Auth/mapper/xml/*.xml