解决:org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returne

异常问题:出现太多结果集异常,意思是当前方法要求返回一个结果,但实际却查到了2个或2个以上的相同结果

org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
 

解决方法:

原mapper接口方法

Admin checkLogin(String username,String password);

修改后mapper接口方法,将原来的方法返回类型改为list<T>

List<Admin> checkLogin(String username,String password);

猜你喜欢

转载自blog.csdn.net/qq_53376718/article/details/133445499