报错信息
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.kuang.mybatis_plus_study.Mapper.UserMapper.selectList
解释:就是说,你的Mapper接口,被Spring注入后,却无法正常的使用mapper.xml的sql;
这里的Spring注入后的意思是,你的接口已经成功的被扫描到,但是当Spring尝试注入一个代理(MyBatis实现)的实现类后,却无法正常使用。
原因
仔细查询资料以后发现是在UserMapperextend编写时 继承BaseMapper时未
使用泛型。
@Mapper
@Repository
public interface UserMapper extends BaseMapper{
}
正确代码:
@Mapper
@Repository
public interface UserMapper extends BaseMapper <User>{
}