在使用mybatis时,传入多个不同的参数报如下错误
Caused by: org . apache . ibatis . binding. BindingException: Parameter 'currentPage' not found. Available parameters are [arg1, arg0, param1, param2 ]
错误原因,没有加@Param注解
错误写法:
List<CheckItem> queryPage2(Integer currentPage,Integer pageSize);
long findcount(Integer currentPage, Integer pageSize);
正确写法:加上@Param注解即可
List<CheckItem> queryPage2(@Param("currentPage")Integer currentPage,@Param("pageSize") Integer pageSize);
long findcount(@Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize);