|  |  | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.*; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  |  | 
 |  |  | @Slf4j | 
 |  |  | 
 |  |  |         return rsVo ; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Map<String, List<BaPrivilege>> selectByType(){ | 
 |  |  |     public List<Map<String, Object>> selectByType(){ | 
 |  |  |         List<BaPrivilege> priList = dao.selectAll(); | 
 |  |  |         Map<String, List<BaPrivilege>> map = priList.stream() | 
 |  |  |                 .collect(Collectors.groupingBy(BaPrivilege::getTypeName)); | 
 |  |  |         return map; | 
 |  |  |         List<Map<String,Object>> resultList=new ArrayList<>(); | 
 |  |  |         map.forEach((key, value) -> { | 
 |  |  |             Map<String, Object> temp = new HashMap<>(); | 
 |  |  |             temp.put("name", key); | 
 |  |  |             temp.put("list", value); | 
 |  |  |             resultList.add(temp); | 
 |  |  |         }); | 
 |  |  |         return resultList; | 
 |  |  |     } | 
 |  |  | } |