org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [0, 1, param1, param2]

--- --- restore content begins

 

1.dao layer as follows:

@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. Use the postman passed json parameters are as follows

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

3. given as follows:

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 is modified as follows:

@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 from : http: //www.cnblogs.com/durui/p/8279117.html

--- end --- restore content

Guess you like

Origin www.cnblogs.com/jhjlcr/p/11241397.html