org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ruoyi.community.mapper.HealthMapper.selectList
时间: 2023-10-17 22:32:26 浏览: 93
MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ruoyi.community.mapper.HealthMapper.selectList 是一个MyBatis的绑定异常。这个异常通常出现在在MyBatis的mapper接口与对应的mapper配置文件之间存在映射绑定问题时。其中,com.ruoyi.community.mapper.HealthMapper.selectList是一个无效的绑定语句,可能有以下几种原因导致异常的发生:
1. mapper接口与mapper配置文件之间的命名不一致,导致无法正确找到对应的SQL语句。请检查HealthMapper接口中的方法名是否与mapper配置文件中的selectList语句的id一致。
2. mapper配置文件中没有正确配置对应的selectList语句。请确保mapper配置文件中存在id为selectList的select语句,并且该语句正确地映射到了数据库表中的列。
3. mapper接口的返回类型与mapper配置文件中的结果映射没有正确配置。如果HealthMapper的方法返回值是List<User>,则需要在selectList语句的配置中正确配置ResultMap或ResultType,以使MyBatis能够将查询结果正确地映射到User对象的属性上。
请检查以上几个方面,确保mapper接口与mapper配置文件之间的映射绑定正确无误,以解决该异常。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 解决方法](https://blog.csdn.net/P081130110/article/details/106695947)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)原因总结](https://blog.csdn.net/m0_66173671/article/details/122337771)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文