Request processing failed nested exception is org.mybatis.spring

整合ssm时,当对数据库进行操作时报错:Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘teacher_id’ not found. Available parameters are [arg1, arg0, param1, param2]

标题在这里插入图片描述

后来发现原来当方法中的参数多个时要在*mapper.java中使用@Param修饰参数,当只有一个参数时,Mapper中可以不使用
eg: public Teacher_Course findById(@Param(“teacher_id”)int teacher_id, @Param(“course_name”)String course_name);

参考:https://blog.csdn.net/sinat_29325027/article/details/51143448?_t_t_t=0.2515934589002933


版权声明:本文为weixin_45081813原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。