首页 > 编程语言 > 详细

在Springboot中Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]问题

时间:2019-04-06 19:37:59      阅读:2991      评论:0      收藏:0      [点我收藏+]

 

1.dao层如下:

@Select("select id,username,password, phone, email, created, updated from mb_user where username=#{username} and password=#{password}")
UserEntity loginT(@Param("username") String username, @Param("password") String password);

2.使用postman传入json参数如下

{
"username":"644069",
"password":"123456"
}

3.报错如下:

ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - 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 [0, 1, param1, param2]] with root cause
org.apache.ibatis.binding.BindingException: Parameter ‘username‘ not found. Available parameters are [0, 1, param1, param2]

4.修改如下:

@Select("select id,username,password, phone, email, created, updated from mb_user where username=#{0} and password=#{1}")
UserEntity loginT(@Param("username") String username, @Param("password") String password);

5来源于:http://www.cnblogs.com/durui/p/8279117.html

在Springboot中Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]问题

原文:https://www.cnblogs.com/jhjlcr/p/10662576.html

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