Example #1
0
        private List <PrbView> QueryTopViewsByPolicy(IEnumerable <PrbView> source, int topCount,
                                                     OrderPrbStatPolicy policy)
        {
            switch (policy)
            {
            case OrderPrbStatPolicy.OrderByPdschDtchPrbRateDescending:
                return(source.OrderByDescending(x => x.PdschDtchPrbRate).Take(topCount).ToList());

            case OrderPrbStatPolicy.OrderByPdschHighUsageDescending:
                return(source.OrderByDescending(x => x.PdschHighUsageSeconds).Take(topCount).ToList());

            case OrderPrbStatPolicy.OrderByPdschPrbRateDescending:
                return(source.OrderByDescending(x => x.PdschPrbRate).Take(topCount).ToList());

            case OrderPrbStatPolicy.OrderByPuschDtchPrbRateDescending:
                return(source.OrderByDescending(x => x.PuschDtchPrbRate).Take(topCount).ToList());

            case OrderPrbStatPolicy.OrderByPuschHighUsageDescending:
                return(source.OrderByDescending(x => x.PuschHighUsageSeconds).Take(topCount).ToList());

            case OrderPrbStatPolicy.OrderByPuschPrbRateDescending:
                return(source.OrderByDescending(x => x.PuschPrbRate).Take(topCount).ToList());
            }
            return(new List <PrbView>());
        }
Example #2
0
        public List <PrbView> QueryTopPrbViews(string city, string district, DateTime begin, DateTime end,
                                               int topCount, OrderPrbStatPolicy policy)
        {
            var joinViews = QueryDistrictViews(city, district, begin, end).ToList();
            var days      = (joinViews.Max(x => x.StatTime) - joinViews.Min(x => x.StatTime)).Days + 1;

            return(QueryTopViewsByPolicy(joinViews, topCount * days, policy));
        }
Example #3
0
        public List <PrbView> QueryTopPrbViews(DateTime begin, DateTime end, int topCount, OrderPrbStatPolicy policy)
        {
            var zteStats    = ZteRepository.FilterTopList(begin, end);
            var huaweiStats = HuaweiRepository.FilterTopList(begin, end);
            var joinViews   = HuaweiCellRepository.QueryAllFlowViews <PrbView, PrbZte, PrbHuawei>(zteStats, huaweiStats).ToList();
            var days        = (joinViews.Max(x => x.StatTime) - joinViews.Min(x => x.StatTime)).Days + 1;

            return(QueryTopViewsByPolicy(joinViews, topCount * days, policy));
        }
Example #4
0
        public List <HourPrbView> QueryTopPrbViews(DateTime begin, DateTime end, int topCount, OrderPrbStatPolicy policy)
        {
            var stats     = Repository.FilterTopList(begin, end);
            var joinViews = stats.MapTo <List <HourPrbView> >();
            var days      = (joinViews.Max(x => x.StatTime) - joinViews.Min(x => x.StatTime)).Days + 1;

            return(QueryTopViewsByPolicy(joinViews, topCount * days, policy));
        }