Parameter '0' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]

来源:互联网 发布:java 没错溢出 编辑:程序博客网 时间:2024/06/05 04:07
解决org.apache.ibatis.binding.BindingException: Parameter '0' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2] 问题

错误的情况:


1.修改

[html] view plain copy
  1. <update id="updateStatusById" parameterType="java.lang.Integer">    
  2.         update  
  3.         nic_techsupport  
  4.         set status_id = #{0}  
  5.         where techsupport_id =#{1}  
  6.     </update>  
[html] view plain copy
  1. <update id="updateStatusById" parameterType="java.lang.Integer">    
  2.         update  
  3.         nic_techsupport  
  4.         set status_id = #{arg0}  
  5.         where techsupport_id =#{arg1}  
  6.     </update>  
在MyBatis3.4.4版不能直接使用#{0}要使用 #{arg0}

还有就是吧mybatis的版本改为低版本 比如改为 3.2.1

<dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.2.1</version></dependency>





阅读全文
0 0