Mybatis使用过程中出现的错误

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'f0002s' not found. Available parameters are [arg1, arg0, param1, param2]

  @Select("select * from t0002 where f0002 = #{f0002} and f0003 = #{f0003} and f0012 = 1 ")
  T0002 selectByF0002F0003(String f0002,String f0003);

当传送多个参数时,必须要使用@Param参数进行标识,当只有一个参数时,可以不使用@param。所以正确的写法为

@Select("select * from t0002 where f0002 = #{f0002} and f0003 = #{f0003} and f0012 = 1 ")
T0002 selectByF0002F0003(@Param("f0002") String f0002, @Param("f0003") String f0003);

猜你喜欢

转载自blog.csdn.net/huxiaodong1994/article/details/83585867
今日推荐