public Map<String, Object> getMonitorParentCodeIsNull(){
return (Map<String, Object>)monitorDao.getMonitorParentCodeIsNull();
}
MonitorService ms = (MonitorService) context.getBean("monitorService");
Map<String, Object> map = ms.getMonitorParentCodeIsNull();
报如下错误。。
nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 4
select top 1?我就是要查询出所有。top1取了没达到我想要的效果,,,请问有其他办法吗?
追答Mapper里面返回List,就是说Mapper里面的方法声明是
dao、service层也作相应修改,改为返回List<Map<String,Object>>