public IEnumerable <TopMrsRsrpView> GetAllTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy) { return(GetTopViews(begin, end, topCount, policy, (beginDate, endDate) => _topMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate))); }
private IEnumerable <TopMrsRsrpView> GetTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy, Func <DateTime, DateTime, List <TopMrsRsrp> > queryFunc) { if (topCount <= 0) { return(new List <TopMrsRsrpView>()); } var orderResult = new List <TopMrsRsrp>(); var beginDate = begin; var endDate = beginDate.AddDays(1); while (endDate < end) { var stats = queryFunc(beginDate, endDate); if (stats.Any()) { orderResult.AddRange(stats.Where(x => (double)(x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110) / (x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110 + x.Rsrp110To105 + x.Rsrp105To100 + x.Rsrp100To95 + x.Rsrp95To90 + x.Rsrp90To80 + x.Rsrp90To80 + x.Rsrp80To70 + x.Rsrp70To60 + x.RsrpAbove60) > 0.2).Order(policy, topCount)); } beginDate = beginDate.AddDays(1); endDate = beginDate.AddDays(1); } var containers = orderResult.GenerateContainers(); return(containers.Select(x => { var view = TopMrsRsrpView.ConstructView(x.TopMrsRsrp, _eNodebRepository); view.TopDates = x.TopDates; return view; })); }
private IEnumerable <TopCoverageStatView> GetTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy, IEnumerable <ENodeb> eNodebs, Func <DateTime, DateTime, List <CoverageStat> > queryFunc) { if (topCount <= 0) { return(new List <TopCoverageStatView>()); } var orderResult = new List <CoverageStat>(); var beginDate = begin; var endDate = beginDate.AddDays(1); while (endDate < end) { var stats = queryFunc(beginDate, endDate); if (stats.Any()) { orderResult.AddRange(stats.Order(policy, topCount)); } beginDate = beginDate.AddDays(1); endDate = beginDate.AddDays(1); } var containers = orderResult.GenerateContainers <CoverageStat, TopCoverageStatContainer>(); return(containers.Select(x => { var view = TopCoverageStatView.ConstructView(x.TopStat, eNodebs); view.TopDates = x.TopDates; return view; })); }
public IEnumerable <TopCoverageStatView> GetAllTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy) { return(GetTopViews(begin, end, topCount, policy, _eNodebRepository.GetAllList(), (beginDate, endDate) => _repository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.TelecomAbove110 < x.TelecomMrs * 0.6 && x.TelecomMrs > 20000))); }
public IEnumerable <TopMrsRsrpView> GetPartialTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy, IEnumerable <ENodeb> eNodebs) { return(GetTopViews(begin, end, topCount, policy, (beginDate, endDate) => { var stats = _topMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate); return (from q in stats join e in eNodebs on q.ENodebId equals e.ENodebId select q).ToList(); })); }
public IEnumerable <TopCoverageStatView> GetPartialTopViews(DateTime begin, DateTime end, int topCount, OrderMrsRsrpPolicy policy, List <ENodeb> eNodebs) { return(GetTopViews(begin, end, topCount, policy, eNodebs, (beginDate, endDate) => { var stats = _repository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.TelecomAbove110 < x.TelecomMrs * 0.6 && x.TelecomMrs > 20000); return (from q in stats join e in eNodebs on q.ENodebId equals e.ENodebId select q).ToList(); })); }
public static IEnumerable <TopMrsRsrp> Order(this IEnumerable <TopMrsRsrp> stats, OrderMrsRsrpPolicy policy, int topCount) { switch (policy) { case OrderMrsRsrpPolicy.OrderBy105Rate: return (stats.OrderByDescending(x => (double)(x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110 + x.Rsrp110To105) / (x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110 + x.Rsrp110To105 + x.Rsrp105To100 + x.Rsrp100To95 + x.Rsrp95To90 + x.Rsrp90To80 + x.Rsrp90To80 + x.Rsrp80To70 + x.Rsrp70To60 + x.RsrpAbove60)).Take(topCount).ToList()); case OrderMrsRsrpPolicy.OrderBy105TimesDescending: return (stats.OrderByDescending(x => x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110 + x.Rsrp110To105) .Take(topCount) .ToList()); case OrderMrsRsrpPolicy.OrderBy110Rate: return (stats.OrderByDescending(x => (double)(x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110) / (x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110 + x.Rsrp110To105 + x.Rsrp105To100 + x.Rsrp100To95 + x.Rsrp95To90 + x.Rsrp90To80 + x.Rsrp90To80 + x.Rsrp80To70 + x.Rsrp70To60 + x.RsrpAbove60)).Take(topCount).ToList()); default: return (stats.OrderByDescending(x => x.RsrpBelow120 + x.Rsrp120To115 + x.Rsrp115To110) .Take(topCount) .ToList()); } }
public static IEnumerable <CoverageStat> Order(this IEnumerable <CoverageStat> stats, OrderMrsRsrpPolicy policy, int topCount) { switch (policy) { case OrderMrsRsrpPolicy.OrderBy105Rate: return (stats.OrderBy(x => (double)x.TelecomAbove105 / x.TelecomMrs).Take(topCount).ToList()); case OrderMrsRsrpPolicy.OrderBy105TimesDescending: return (stats.OrderBy(x => x.TelecomAbove105) .Take(topCount) .ToList()); case OrderMrsRsrpPolicy.OrderBy110Rate: return (stats.OrderBy(x => (double)x.TelecomAbove110 / x.TelecomMrs).Take(topCount).ToList()); default: return (stats.OrderBy(x => x.TelecomAbove110) .Take(topCount) .ToList()); } }