zoukankan      html  css  js  c++  java
  • Collectors.groupingBy应用

    @Override
    public Map<String, Map<String, List<ServiceGitEntity>>> uiCasePolicyDropList(long jiraBrand) {
    Example example = new Example(ServiceEntity.class);
    Example.Criteria criteria = example.createCriteria();
    criteria.andEqualTo("jiraBrand", jiraBrand);
    List<ServiceEntity> serviceEntities = serviceMapper.selectByExample(example);
    List<GitEntity> gitEntities = gitMapper.getByType(GitType.UT.getCode());
    List<ServiceGitEntity> serviceGitEntities = new ArrayList<>();
    ServiceGitEntity serviceGit = null;
    for (ServiceEntity serviceEntity : serviceEntities) {
    for (GitEntity gitEntity : gitEntities) {
    if (serviceEntity.getId().equals(gitEntity.getServiceId())) {
    serviceGit = new ServiceGitEntity();
    serviceGit.setProject(serviceEntity.getProject());
    serviceGit.setBranch(gitEntity.getBranch());
    serviceGit.setName(serviceEntity.getName());
    serviceGit.setId(serviceEntity.getId());
    serviceGit.setUrl(gitEntity.getUrl());
    if (!serviceGitEntities.contains(serviceGit)) {
    serviceGitEntities.add(serviceGit);
    }
    }
    }
    }
    Map<String, Map<String, List<ServiceGitEntity>>> map = serviceGitEntities.stream().collect(Collectors.groupingBy(ServiceGitEntity::getProject,Collectors.groupingBy(ServiceGitEntity::getName)));
    return map;
    }
  • 相关阅读:
    SQL 数据开发(经典)转贴
    2018学习计划 借鉴
    SQL数据库索引理解与应用【转贴--收藏】
    学生成绩信息表
    网址收录
    导出word文档 通过DocX组件
    Aspose.word
    C#编码规范
    远程连接ORACLE服务
    Request.Form()的使用
  • 原文地址:https://www.cnblogs.com/cristin/p/14277698.html
Copyright © 2011-2022 走看看