spring-boot集成mybatis是容易犯的錯誤

1.當dao層傳遞多個參數是會報錯

org.apache.ibatis.binding.BindingException: Parameter 'productAttributeCategoryId' not found. Available parameters are [arg1, arg0, param1, param2]
	

翻譯如下

org.apache.ibatis.binding.bindingException:找不到參數“productAttributeCategoryID”。可用參數有[arg1、arg0、param1、param2]

  所以sql語句改成如下

 select * from pms_product_attribute
    where product_attribute_category_id=#{arg0}
    and  type=#{arg1}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章