public List <DistrictStat> QueryDistrictStats(string city)
        {
            var eNodebTownIds = _eNodebRepository.GetAllInUseList().Select(x => new
            {
                x.TownId, x.ENodebId
            });
            var btsTownIds = _btsRepository.GetAllInUseList().Select(x => new
            {
                x.TownId, x.BtsId
            });
            var cellENodebIds  = _cellRepository.GetAllInUseList().Select(x => x.ENodebId);
            var cdmaCellBtsIds = _cdmaCellRepository.GetAllInUseList().Select(x => x.BtsId);

            return((from district in GetDistricts(city)
                    let townList = _repository.GetAllList(city, district)
                                   let eNodebs = (from t in townList join e in eNodebTownIds on t.Id equals e.TownId select e)
                                                 let btss = (from t in townList join b in btsTownIds on t.Id equals b.TownId select b)
                                                            let cells = (from t in townList join e in eNodebTownIds on t.Id equals e.TownId join c in cellENodebIds on e.ENodebId equals c select c)
                                                                        let cdmaCells = (from t in townList join b in btsTownIds on t.Id equals b.TownId join c in cdmaCellBtsIds on b.BtsId equals c select c)
                                                                                        select new DistrictStat
            {
                District = district,
                TotalLteENodebs = eNodebs.Count(),
                TotalLteCells = cells.Count(),
                TotalCdmaBts = btss.Count(),
                TotalCdmaCells = cdmaCells.Count()
            }).ToList());
        }
Beispiel #2
0
        public List <DistrictStat> QueryDistrictStats(string city)
        {
            var eNodebTownIds = _eNodebRepository.GetAllInUseList().Select(x => new
            {
                x.TownId,
                x.ENodebId
            });
            var btsTownIds = _btsRepository.GetAllInUseList().Select(x => new
            {
                x.TownId,
                x.BtsId
            });
            var cellENodebs    = _cellRepository.GetAllInUseList();
            var cdmaCellBtsIds = _cdmaCellRepository.GetAllInUseList().Select(x => x.BtsId);

            return((from district in GetDistricts(city)
                    let townList = _repository.GetAllList().Where(x => x.CityName == city && x.DistrictName == district)
                                   let eNodebs = (from t in townList join e in eNodebTownIds on t.Id equals e.TownId select e)
                                                 let btss = (from t in townList join b in btsTownIds on t.Id equals b.TownId select b)
                                                            let cells = (from t in townList
                                                                         join e in eNodebTownIds on t.Id equals e.TownId
                                                                         join c in cellENodebs on e.ENodebId equals c.ENodebId
                                                                         select c)
                                                                        let cdmaCells =
                        (from t in townList
                         join b in btsTownIds on t.Id equals b.TownId
                         join c in cdmaCellBtsIds on b.BtsId equals c
                         select c)
                        select new DistrictStat
            {
                District = district,
                TotalLteENodebs = eNodebs.Count(),
                TotalLteCells = cells.Count(x => x.Frequency < 2504 || x.BandClass == 41),
                Lte800Cells = cells.Count(x => x.BandClass == 5 && x.Frequency >= 2504),
                Lte1800Cells = cells.Count(x => x.BandClass == 3),
                Lte2100Cells = cells.Count(x => x.BandClass == 1),
                Lte2600Cells = cells.Count(x => x.BandClass == 41),
                TotalNbIotCells = cells.Count(x => x.Frequency >= 2504 && x.BandClass == 5),
                TotalCdmaBts = btss.Count(),
                TotalCdmaCells = cdmaCells.Count()
            }).ToList());
        }
Beispiel #3
0
 public IEnumerable <CdmaCellIdPair> GetVanishedCdmaCellIds()
 {
     if (!BasicImportContainer.CdmaCellExcels.Any())
     {
         return(new List <CdmaCellIdPair>());
     }
     return(from cell in _cdmaCellRepository.GetAllInUseList()
            join info in BasicImportContainer.CdmaCellExcels
            on new { cell.BtsId, cell.SectorId, cell.CellType } equals new { info.BtsId, info.SectorId, info.CellType }
            into cellQuery
            from cq in cellQuery.DefaultIfEmpty()
            where cq == null
            select new CdmaCellIdPair {
         CellId = cell.BtsId, SectorId = cell.SectorId, CellType = cell.CellType
     });
 }