Mybatis异常如下:
Exception: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
分析:查询语句是希望返回一条数据,而实际select查询时得到的数据超出一条数据。
解决:查看where条件确定返回数据为一条而非多条数据。