Mybatis异常:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
这个错误信息表明,你在使用MyBatis的selectOne()
方法时,期望返回一个结果,但是查询返回了两个结果。selectOne()
方法在设计上是只返回一个查询结果的。
sql语句出问题了