BUG : HTTP Status 500 - Request Parameter ‘xxxxXxx‘ not found. Available parameters are [qo, param1]

10 篇文章 0 订阅
4 篇文章 0 订阅
"这篇博客讲述了在使用MyBatis时遇到的一个参数未找到的问题,具体表现为HTTP500错误,原因是在SQL查询语句中缺少对`plotId`参数的正确引用。错误代码段展示了在条件查询中,`plotId`参数没有从qo对象中获取。解决方法是将`#{plotId}
摘要由CSDN通过智能技术生成

错误信息

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘plotId’ not found. Available parameters are [qo, param1]
type Exception report

message Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘plotId’ not found. Available parameters are [qo, param1]

description The server encountered an internal error that prevented it from fulfilling this request.

exception

错误截图

错误截图

错误代码

 <sql id="mySQL">
    <where>
      <if test="qo.id != null">
        and id = #{qo.id}
      </if>
      <if test="qo.plotId != null and qo.plotId !=-1">
      	<!-- 错误代码 -->
        and plotId=#{plotId}
      </if>
    </where>
  </sql>

解决办法

其实就是本应从 qo(条件查询的工具类) 中取出的, 但是上面的代码中忘记写了,这也是一个低级的错误.
  • {plotId} 改成 {qo.plotId},如下图所示:
 <if test="qo.plotId != null and qo.plotId !=-1">
      	<!-- 更改代码 -->
        and plotId=#{qo.plotId}
 </if>
如有错误请各位大神指导,叩谢了 ! !
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值