dao接口:
public List findAsPBookByPage(@Param("paramMap")Map paramMap,RowBounds rowBounds);
XML文件:
错误日志:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found. Available parameters are [paramMap, param1]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
at $Proxy27.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:201)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:122)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:90)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
at $Proxy134.findAsPStorageByPage(Unknown Source)
at com.hsit.dbxt.utils.maintain.service.AsPStorageService.findAsPStorageByPage(AsPStorageService.java:283)
at com.hsit.dbxt.utils.maintain.service.AsPStorageService$$FastClassByCGLIB$$50cf36e2.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at com.hsit.dbxt.utils.maintain.service.AsPStorageService$$EnhancerByCGLIB$$eebf7051.findAsPStorageByPage()
at com.hsit.dbxt.utils.maintain.web.PhysicalStoreEsb.getDataGridDs(PhysicalStoreEsb.java:341)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.rop.impl.AnnotationServiceMethodAdapter.invokeServiceMethod(AnnotationServiceMethodAdapter.java:48)
at com.rop.impl.AnnotationServletServiceRouter.doService(AnnotationServletServiceRouter.java:655)
at com.rop.impl.AnnotationServletServiceRouter.access$600(AnnotationServletServiceRouter.java:43)
at com.rop.impl.AnnotationServletServiceRouter$ServiceRunnable.run(AnnotationServletServiceRouter.java:453)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found. Available parameters are [paramMap, param1]
at org.apache.ibatis.binding.MapperMethod$MapperParamMap.get(MapperMethod.java:262)
at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:40)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:123)
at org.apache.ibatis.executor.parameter.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:83)
at com.ridge.dao.mybatis.CountHelper.getCount(CountHelper.java:64)
at com.ridge.dao.mybatis.PaginationInterceptor.intercept(PaginationInterceptor.java:78)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:57)
at $Proxy185.prepare(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:70)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354)
... 30 more
这个错误是当有list传入的时候就会出现,找了好久,没找到原因
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
<if test="params.workAddress!=null and params.workAddress.size()>0 ">
AND
<foreach collection="params.workAddress" index="index" item="item" open="(" separator="or" close=")">
</foreach>
</if>
我这样写的 可以了。
楼主这个问题解决了吗?我也遇上了。。。