mybatis puls org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.dao.UsedDao.selectList
时间: 2023-11-01 18:57:38 浏览: 162
这个错误是由于mybatis-plus无法找到指定的mapper方法引起的。可能是因为mapper接口没有被正确地扫描和注册到mybatis-plus的配置中所导致的。你可以检查一下mybatis-plus的配置文件,确保mapper接口已经被正确地配置和注册了。
另外,请注意使用mybatis-plus时,不能使用自带的SqlSessionFactory,需要使用MybatisSqlSessionFactory。你可以在配置类中加入如下配置(适用于Spring Boot项目):
```java
@Primary
@Bean("db1SqlSessionFactory")
public SqlSessionFactory db1SqlSessionFactory(DataSource dataSource) throws Exception {
/**
* 使用 mybatis plus 配置
*/
MybatisSqlSessionFactoryBean b1 = new MybatisSqlSessionFactoryBean();
b1.setDataSource(dataSource);
b1.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));
return b1.getObject();
}
```
希望以上信息对你有帮助。如果你有任何进一步的问题,请随时提出。
阅读全文
相关推荐


















