org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

问题现象:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxxxxxxxxTLRepository.EtlTaskListMapper.getListByWaitingSetting
	at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:227)
	at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:49)
	at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	at com.sun.proxy.$Proxy91.getListByWaitingSetting(Unknown Source)
	at comxxxx.service.EtlTaskListServiceImpl.getListByWaitingSetting(EtlTaskListServiceImpl.java:37)
	at comxxxx.controller.EtlTaskController.mainFlagOperation(EtlTaskController.java:314)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

问题原因/解决方案

根本原因,mapper.xml和mapper接口里面的不对应!大白话说,就是接口mapper 里面写的id 是getList()然后你mapper.xml 里面没有 id=getList()的。

然而许多说我xml里面明明有这个id

    <select id="getListByWaitingSetting " resultMap="EtlTaskListBeanResultMap" >

实际,id里面有空格也不行,如上所示。

©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页