MyBatis报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sobadstan.work.mapper.XTMapper.updateBM

MyBatisX插件都能找到了 为什么还会报错
MyBatis报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sobadstan.work.mapper.XTMapper.updateBM

以下内容由CHATGPT及阿里嘎多学长共同生成、有用望采纳:
根据您提供的图片内容和错误信息,以下是解决MyBatis中BindingException错误的步骤:
确认MyBatis配置文件中的namespace:
<mapper namespace="com.sobadstan.work.mapper.XTMapper"> 已经定义,这一步看起来是正确的。检查XML映射文件中的"updateBM"方法声明:
XTMapper.xml文件中是否存在一个<update>标签,其id属性设置为updateBM。例如:
<update id="updateBM">
<!-- SQL语句 -->
</update>
确保MyBatis配置和依赖是最新的:
pom.xml或build.gradle文件,确保MyBatis及其相关依赖是最新的,并且没有版本冲突。检查"XTMapper.xml"文件中的SQL映射语句:
XTMapper.xml文件中的<update>标签,确保updateBM对应的SQL语句存在且格式正确。例如:
<update id="updateBM">
UPDATE t_bm SET ... WHERE ...
</update>
检查MyBatis插件和IDE配置:
检查Spring Boot配置:
@MapperScan注解,例如:
@SpringBootApplication
@MapperScan("com.sobadstan.work.mapper")
public class WorkApplication {
public static void main(String[] args) {
SpringApplication.run(WorkApplication.class, args);
}
}
检查日志和异常堆栈:
参考文档:
由于我无法直接查看和编辑您的代码文件,以上步骤是基于您提供的信息和常见的问题解决策略。如果您需要更具体的代码实现或参考资料,您可以访问MyBatis的官方文档和GitHub仓库,那里有详细的指南和示例代码。