解决org.apache.ibatis.binding.BindingException: Parameter '0' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2] 问题
为
在MyBatis3.4.4版不能直接使用#{0}要使用
#{arg0}
错误的情况:
1.修改
- <update id="updateStatusById" parameterType="java.lang.Integer">
- update
- nic_techsupport
- set status_id = #{0}
- where techsupport_id =#{1}
- </update>
- <update id="updateStatusById" parameterType="java.lang.Integer">
- update
- nic_techsupport
- set status_id = #{arg0}
- where techsupport_id =#{arg1}
- </update>
还有就是吧mybatis的版本改为低版本 比如改为 3.2.1
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.1</version>
</dependency>