Spring Boot中报错org.apache.ibatis.binding.BindingException: Parameter 'XXXX' not found. Available parameters are [0, 1, param1, param2]的解决办法
我这里的报错信息显示:
org.apache.ibatis.binding.BindingException: Parameter 'reqUsername' not found. Available parameters are [0, 1, param1, param2]
原因:当只有一个参数时,Mapper中可以不使用@Param,但是当有多个参数的时候,要使用@Param。
原来的代码:
@Select("select * from tz_user where " + GlobalConfigure.USER_AUTH_SQL_SUFFIX)
List<User> getAllUser(String reqUsername, String reqPasswd);
改成:
@Select("select * from tz_user where " + GlobalConfigure.USER_AUTH_SQL_SUFFIX)
List<User> getAllUser(@Param("reqUsername") String reqUsername, @Param("reqPasswd") String reqPasswd);
就成功返回结果了。
Spring Boot中报错org.apache.ibatis.binding.BindingException: Parameter 'XXXX' not found. Available parameters are [0, 1, param1, param2]的解决办法的更多相关文章
- Mybatis报错 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'parentCode' not found. Available parameters are [0, 1, param1, param2]
orcal数据库使用mybatis接收参数,如果传的是多个参数,需要使用#{0},#{1},...等代替具体参数名,0 代表第一个参数,1 代表第二个参数,以此类推. 错误语句: <select ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [arg1, arg0, param1, param2]
2018-06-27 16:43:45.552 INFO 16932 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : ...
- Springboot-001-解决nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]
环境:Springboot + Mybatis + MySQL + VUE 场景: 前端发出数据比对请求,在服务后台与数据库交互时,接口提示错误信息如下所示: { "code": ...
- ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]
org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ib ...
- SpringBoot整合Mybatis注解版---update出现org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0, param1, param2]
SpringBoot整合Mybatis注解版---update时出现的问题 问题描述: 1.sql建表语句 DROP TABLE IF EXISTS `department`; CREATE TABL ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'employeeId' not found. Available parameters are [page, map, param1, param2] 解决方法
原因很简单就是没映射到接口添加 @Param 注解 ->@Param("map") 然后在mapper.xml map.employeeId 再次测试 已经解决 ->
- org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2]
这个异常说明参数没有加上@Param注解,加上这个注解就行了. 默认情况下mybatis把参数按顺序转化为[0, 1, param1, param2],也就是说#{0} 和 #{param1} 是一样 ...
- 怪事年年有,今天特别多!org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'empno' not found. Available parameters are [emp, deptno, param1, param
错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Binding ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]
Spring+mybatis错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi ...
随机推荐
- nomn文件分析
#encoding=gbk import os import re import math from os import path ''' 手动输入文件nmon文件路径,要截取的开始时间,结束时间 ' ...
- js中in关键字的使用方法
1.for...in 对数组或对象的循环/迭代操作 对于数组循环出来的是数组元素:对于对象循环出来的是对象属性 2.判断对象是否是数组/对象的元素/属性 格式:(变量 in 对象) 当‘对象’是数组时 ...
- idea jsp文件中body标签内引入编辑器后提示statement expected
解决方案: 1.用标签将script包一层解决问题 2.或者在</script>后添加自闭和标签(推荐) <input/>.<img/> //等等自闭和标签
- python函数的作用域和引用范围
以下内容参考自runoob网站,以总结python函数知识点,巩固基础知识,特此鸣谢! 原文地址:http://www.runoob.com/python3/python3-function.html ...
- selenium报错以及各解决方法
1.driver.findElement(By.name("wd")).sendKeys("selenium"); 报错:The method sendKeys ...
- 9、Spring Boot 2.x 集成 Thymeleaf
1.9 Spring Boot 2.x 集成 Thymeleaf 完整源码: Spring-Boot-Demos 1.9.1 在pom中引入依赖 <dependency> <grou ...
- django post请求 403错误解决方法
--摘 第一次用Django做项目,遇到了很多问题. 今天遇到的问题是Django在处理post请求时多次出现403错误. 我先描述一下问题出现的环境:我用Django写了一个web服务端,姑且称它为 ...
- 设计模式--UML类图简介
UML:Unified Modelling Language是一种统一建模语言(英语:Unified Modeling Language,缩写 UML)是非专利的第三代建模和规约语言. “+”表示pu ...
- CONTINUE...? ZOJ - 4033
CONTINUE...? ZOJ - 4033 题解:先计算一下总数sum是否是偶数,如果不是则不能分出来,如果是则从后面开始分,先把人分到1.3组,分完sum / 2这些人,如果恰好能够分成零,那么 ...
- I Hate It (HDU 1754)
Problem 很多学校流行一种比较的习惯.老师们很喜欢询问,从某某到某某当中,分数最高的是多少. 这让很多学生很反感. 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师 ...