orcal数据库使用mybatis接收参数,如果传的是多个参数,需要使用#{0},#{1},。。。等代替具体参数名,0 代表第一个参数,1 代表第二个参数,以此类推。

错误语句:

<select id = "findNameByCode" resultMap="resultMap">
select
name,code
from
table
<where>
code = #{code} and name = #{name}
</where>
</select>

正确语句:

<select id = "findNameByCode" resultMap="resultMap">
select
name,code
from
table
<where>
code = #{0} and name = #{1}
</where>
</select>
如果需要对参数使用<if>进行判断的话,需要在XXXDAO.java接口层使用@Param注解 : void get(@Param("value") String name);
  注: @Param中的参数需要跟 <if test=""> 中的判读参数一致, eg : 使用上面的DAO接口,Mapper中判断 : <if test="value != null and value != ''">

Mybatis报错 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'parentCode' not found. Available parameters are [0, 1, param1, param2]的更多相关文章

  1. 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].[/]       : ...

  2. 怪事年年有,今天特别多!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 ...

  3. 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 再次测试 已经解决 ->

  4. 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 ...

  5. 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": ...

  6. 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 ...

  7. 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 ...

  8. nested exception is org.apache.ibatis.binding.BindingException: Parameter 'cons_id' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]

    修改DAO层的类中的方法,如下所示:

  9. MyBatis 传List参数 nested exception is org.apache.ibatis.binding.BindingException: Parameter 'idList' not found.

    在MyBatis传入List参数时,MyBatis报错:nested exception is org.apache.ibatis.binding.BindingException: Paramete ...

随机推荐

  1. Ubuntu使用(一)——常用命令与软件安装配置

    1.安装输入法 2.配置JDK 3.eclipse 3.1 eclipse启动错误 修改eclipse.init的配置,主要加-vm以及下面的jre路径,路径前别留空格 之前因为加了空格,一直找不到原 ...

  2. Linux学习笔记之Django项目部署(CentOS)

    一.引入 用Django写了一个测试的项目,现在要部署在Linux上,一般这种情况下,只要在项目里面敲一行命令:python manage.py runserver 0.0.0.0:8000就行了.但 ...

  3. DirBuste 使用

    https://sourceforge.net/projects/dirbuster/ 官网下载 记得安装java 运行环境 这是扫描 443 端口的数据 也可以自己写字典规则 在选择模糊查询时 下面 ...

  4. [android] xml文件的序列化

    生成xml文件,模拟备份短信,创建短信的业务bean,创建一个domain的包放业务bean,这个业务bean里面,定义成员属性,生成get set方法,生成有参和无参的构造方法. 生成随机数,实例化 ...

  5. 谈下mysql预处理基础

    传统的操作数据库方法有两种: 先写一条sql语句,然后通过mysqli->query($sql)去操作数据库(此处使用的是mysqli扩展库).这样操作并不会有什么大的错误,但是当要插入上千条上 ...

  6. Java静态数据的初始化

    Java中无论创建多少对象,静态数据都只占一份存储区域. 下面程序示例静态存储区域的初始化: //: initialization/StaticInitialization.java // Speci ...

  7. DNS到底是干什么用的

    DNS,DomainNameSystem或者DomainNameService(域名系统或者余名服务).域名系统为Internet上的主机分配域名地址和IP地址.用户使用域名地址,该系统就会自动把域名 ...

  8. Html中的img标签 加载失败

    在Http请求时,有时会遇到img图片标签加载失败,不显示的情况: 解决方法,在重新给src属性赋值时,先将onerror事件清除掉,再赋值,这样就不会存在循环调用问题了,代码如下; <img ...

  9. Python mysql 创建连接

    安装 pymysql 模块 pip3 install pymysql # python2, 默认无 pip 命令 # python3, 默认自带 pip3 命令 mysql基本操作 # 导入 pymy ...

  10. jQuery效果之封装一个文章图片弹出放大效果

    首先先搭写一个基本的格式: $.fn.popImg = function() { //your code goes here } 然后用自调用匿名函数包裹你的代码,将系统变量以变量形式传递到插件内部, ...