HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemExc

  • HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘patint_name’ not found. Available parameters are [patint, size, param3, param1, age, param2]

在这里插入图片描述

  • 如果mapper类中使用了@Param 且参数类型是对象类型如下图
  • 在这里插入图片描述
  • 那么在mapper.xml文件中取属性值不能直接是属性字段了,必须是@param注解里的对象 如下图 必须是patint.patint_name来获取对象参数值(sql标签if 里判断的时候也是一样不能直接使用对象属性字段)
    在这里插入图片描述