mybatis Error setting non null for parameter #2 with JdbcType null . 分页错误

今天项目开发时候,出现这个错误;
在使用pageHelp进行分页查询时,除了这个错误:
意思是我们传入了两个参数,但是SQL语句只有一个参数(2 > number of parameters, ) 导入错误;
查看我们的SQL语句:

<if test="orderBy == 3">
            order by cpr.`status` asc                            - - 价格降序
</if>

解决方法:
pageHelp分页就是往SQL语句最后添加limit ?
我们这里使用行尾注释 导致limit ?被注释了,少了一个参数出错
去掉行尾注释就好了

com.kunchi.kshop.channel.spi.kmng.home.KmngProductSearchSpi:调用过程发生未知异常:nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘Second_PageHelper’, mode=IN, javaType=class java.lang.Integer, jdbcType=null, numericScale=null, resultMapId=‘null’, jdbcTypeName=‘null’, expression=‘null’}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 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 (2 > number of parameters, which is 1).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值