Parameter 'first' not found. Available parameters are [0, 1, param1, param2]

報錯日誌

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'first' not found. Available parameters are [0, 1, param1, param2]] with root cause
org.apache.ibatis.binding.BindingException: Parameter 'first' not found. Available parameters are [0, 1, param1, param2]

出錯的Mapper.java

List<WsMenu> twoParam(Integer first, Integer second);

解決辦法(指定參數別名):

List<WsMenu> twoParam(@Param("first") Integer first,@Param("second") Integer second);

 

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