Parameter 'id' not found. Available parameters are [0, 1, param1, param2]

报错:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userid' not found. Available parameters are [0, 1, param1, param2] org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:76) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:421) com.sun.proxy.$Proxy17.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:69) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)

............

解决办法:

Mapper.java中原来是:

int identifyAuth_repository(Integer userid,Integer permissionid);

修改为:

int identifyAuth_repository(@Param("userid")Integer userid,@Param("permissionid")Integer permissionid);


阅读更多

没有更多推荐了,返回首页