zoukankan      html  css  js  c++  java
  • mybatis中传入多个参数时,接口调用报错Parameter '*****' not found ...

    报错:

    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);
  • 相关阅读:
    MySQL远程登陆
    一键安装LAMP wordpress
    编译安装httpd2.4.46
    RDB转化AOF 花式删库
    3周作业
    2周作业
    1周作业
    预习第三周作业
    预习第二周作业
    预习第一周作业
  • 原文地址:https://www.cnblogs.com/adao21/p/13661952.html
Copyright © 2011-2022 走看看