Spring boot 报错 1:Expected one result (or null) to be returned by selectOne(), but found: 9"

接口报错: 

"timestamp": "2019-05-01 16:09:11",
  "status": 500,
  "error": "Internal Server Error",
  "message": "nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 9",
  "trace": "org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 9\r\n\tat 

后台:Spring boot 报错 1:Expected one result (or null) to be returned by selectOne(), but found: 9 

摆明:期望查到的数据是一条记录或者是空,但是查到了9条;

问题:检查自己的mapper.xml 中的查询语句是否未加限制。

Spring boot 报错 1:Expected one result (or null) to be returned by selectOne(), but found: 9 

缺少where语句

添加后完成查询。

你可能感兴趣的:(Spring,boot)