报错:Invalid bound statement (not found): com.mp.dao.UserMapper.selectAll的原因及解决办法
关于SpringBoot使用Mybatis-plus手动配置xxMapper.xml文件报错信息
首先检查是否因为拼写错误或大小写错误导致报错!!!如果看不出来,建议使用复制粘贴
报错实质:
dao层(mapper接口)与xxMapper.xml文件没有映射成功,绑定失败!!
报错原因:
1.各个文件位置错误
dao层——xxMapper(接口文件)
resources/mapper文件夹——xxMapper.xml文件

2.配置错误
- 配置文件:application.yml或application.properties
检查路径是否正确
mybatis-plus:mapper-locations: classpath*:/mapper/*.xml
- xxMapper.xml文件
<mapper namespace="com.mp.dao.UserMapper"> <select id="selectAll" resultType="com.mp.entity.User">select * from user ${ew.customSqlSegment}select>
mapper>
@Mapper
public interface UserMapper extends BaseMapper<User> {List<User> selectAll (@Param(Constants.WRAPPER) Wrapper<User> wrapper);
}
我的报错信息如下:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mp.dao.UserMapper.selectAllat org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235)at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.<init>(MybatisMapperMethod.java:49)at com.baomidou.mybatisplus.core
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
