1. 程式人生 > >Mybatis使用過程中出現的錯誤

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);