做项目过程中出现以下异常情况:
Parameter '0' not found. Available parameters are [arg1, arg0, param1, param2]
Parameter 'xxx’ not found
原因:可能是IDEA版本不同造成的;
从controller传了两个参数a和b,如果mapper,xml里面的sql这么写:select xx from table where 参数1 = #{a} and 参数2 = #{b}则报错
解决办法:
此时应该将sql改为select xx from table where 参数1 = #{arg0} and 参数2 = #{arg1},#{arg0}表示a ,#{arg1}表示b,则成功。