public List <TownMrsRsrp> QueryTownViews(DateTime begin, DateTime end, int townId, FrequencyBandType frequency) { var query = _repository.GetAllList( x => x.StatDate >= begin && x.StatDate < end && x.FrequencyBandType == frequency && x.TownId == townId) .OrderBy(x => x.StatDate) .ToList(); return(query); }
public MrsRegionDateView QueryLastDateStat(DateTime initialDate, string city) { var stats = _statRepository.QueryDate(initialDate, (repository, beginDate, endDate) => { var query = _statRepository.GetAllList(x => x.StatDate >= beginDate & x.StatDate < endDate); return(query.FilterTownList(_townRepository.GetAllList().Where(x => x.CityName == city).ToList())); }); var townViews = stats.ConstructViews <TownMrsRsrp, TownMrsRsrpView>(_townRepository); return(townViews.QueryRegionDateDateView <MrsRegionDateView, DistrictMrsRsrpView, TownMrsRsrpView>(initialDate, DistrictMrsRsrpView.ConstructView)); }
public IEnumerable <PreciseHistory> GetPreciseHistories(DateTime begin, DateTime end) { var results = new List <PreciseHistory>(); while (begin < end.AddDays(1)) { var beginDate = begin.Date; var endDate = beginDate.AddDays(1); var items = _repository.GetAllList(beginDate, endDate); var townItems = _regionRepository.GetAllList(x => x.StatTime >= beginDate && x.StatTime < endDate); var townMrsItems = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate); var topMrsItems = _topMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate); results.Add(new PreciseHistory { DateString = begin.ToShortDateString(), StatDate = begin.Date, PreciseStats = items.Count, TownPreciseStats = townItems.Count, TownMrsStats = townMrsItems.Count, TopMrsStats = topMrsItems.Count }); begin = begin.AddDays(1); } return(results); }
public IEnumerable <RsrpHistory> GetRsrpHistories(DateTime begin, DateTime end) { var results = new List <RsrpHistory>(); while (begin < end.AddDays(1)) { var beginDate = begin.Date; var endDate = beginDate.AddDays(1); var townMrsItems = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.All); var collegeMrsItems = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.College); var marketMrsItems = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.Market); var transportationMrsItems = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.Transportation); var townMrsItems800 = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.Band800VoLte); var townMrsItems1800 = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.Band1800); var townMrsItems2100 = _townMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate && x.FrequencyBandType == FrequencyBandType.Band2100); var topMrsItems = _topMrsRsrpRepository.GetAllList(x => x.StatDate >= beginDate && x.StatDate < endDate); results.Add(new RsrpHistory { DateString = begin.ToShortDateString(), StatDate = begin.Date, TownMrsStats = townMrsItems.Count, CollegeMrsStats = collegeMrsItems.Count, MarketMrsStats = marketMrsItems.Count, TransportationMrsStats = transportationMrsItems.Count, TownMrsStats800 = townMrsItems800.Count, TownMrsStats1800 = townMrsItems1800.Count, TownMrsStats2100 = townMrsItems2100.Count, TopMrsStats = topMrsItems.Count }); begin = begin.AddDays(1); } return(results); }