记一次MyBatis分页莫名其妙的失效,首次执行合适,后续执行分页失效且异常

代码几乎一样,为啥这个xml配置的就会出现莫名其妙的问题呢

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='mybatis_plus_first', mode=IN, javaType=long, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #3 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)

at com.sun.proxy.$Proxy131.selectList(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)

at com.sun.proxy.$Proxy237.getSearchIndexByPage(Unknown Source)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl.getSearchIndexByPage(SearchIndexServiceImpl.java:31)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl$$FastClassBySpringCGLIB$$bb45ed4a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:57)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl$$EnhancerBySpringCGLIB$$3684ef87.getSearchIndexByPage(<generated>)

at com.bigdatacd.panorama.system.controller.SearchIndexController.getSearchIndexByPage(SearchIndexController.java:40)

at com.bigdatacd.panorama.system.controller.SearchIndexController$$FastClassBySpringCGLIB$$cc3a314a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

最后,发现xml的注释 如-- 这样的会引起解析分页失败好吧,不追究了奇奇怪怪的问题

相关推荐
新world10 分钟前
mybatis-plus从入门到入土(二):单元测试
单元测试·log4j·mybatis
RainbowSea4 小时前
问题 1:MyBatis-plus-3.5.9 的分页功能修复
java·spring boot·mybatis
JAVA学习通7 小时前
Mybatis----留言板
mybatis
双力臂40414 小时前
MyBatis动态SQL进阶:复杂查询与性能优化实战
java·sql·性能优化·mybatis
慕y27417 小时前
Java学习第十五部分——MyBatis
java·学习·mybatis
一勺菠萝丶1 天前
Spring Boot + MyBatis/MyBatis Plus:XML中循环处理List参数的终极指南
xml·spring boot·mybatis
coding and coffee1 天前
狂神说 - Mybatis 学习笔记 --下
java·后端·mybatis
耀耀_很无聊2 天前
07_通过 Mybatis 自动填充记录的创建时间和更新时间
mybatis
程序员张32 天前
SQL分析与打印-p6spy组件
spring boot·sql·mybatis·mybatisplus·p6spy
喜欢敲代码的程序员3 天前
SpringBoot+Mybatis+MySQL+Vue+ElementUI前后端分离版:项目搭建(一)
spring boot·mysql·elementui·vue·mybatis