首页 > 其他 > 详细

mybatis中传入多个参数时,接口调用报错Parameter '*****' not found ...

时间:2020-09-13 17:21:21      阅读:77      评论:0      收藏:0      [点我收藏+]

 

报错:

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 ‘username‘ not found. Available parameters are [arg1, arg0, param1, param2]

问题代码:

@Select("select adminId,adminName,sex,tel,email,cardId,role from admin where adminId = #{username} and pwd = #{password}")
public Admin adminLogin(Integer username, String password);
解决办法:
@Select("select adminId,adminName,sex,tel,email,cardId,role from admin where adminId = #{username} and pwd = #{password}")
public Admin adminLogin(@Param("username")Integer username,@Param("password") String password);

 

mybatis中传入多个参数时,接口调用报错Parameter '*****' not found ...

原文:https://www.cnblogs.com/adao21/p/13661952.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!