예제 #1
0
 /// <summary>
 /// 按路口查询视频数据化结构数据集合
 /// </summary>
 /// <param name="lanes">车道集合</param>
 /// <param name="structType">视频结构化数据类型</param>
 /// <param name="startTime">开始时间</param>
 /// <param name="endTime">结束时间</param>
 /// <param name="pageSize">分页页码</param>
 /// <param name="pageNum">分页数量</param>
 /// <param name="hasTotal">是否查询总数</param>
 /// <returns>视频数据化结构数据集合</returns>
 public virtual PageModel <VideoStruct> QueryList(List <Lane> lanes, VideoStructType structType, DateTime startTime, DateTime endTime, int pageNum, int pageSize, bool hasTotal)
 {
     return(SelectList(BranchDbConvert.GetQuerables(startTime, endTime, _context.Queryable(structType)), lanes.Select(l => l.DataId).ToHashSet(), startTime, endTime, pageNum, pageSize, hasTotal));
 }
예제 #2
0
        /// <summary>
        /// 按车道查询流量数据
        /// </summary>
        /// <param name="lanes">车道集合</param>
        /// <param name="level">时间粒度</param>
        /// <param name="startTimes">开始时间集合</param>
        /// <param name="endTimes">结束时间集合</param>
        /// <param name="baseTime">基准时间</param>
        /// <param name="flowTypes">流量密度数据</param>
        /// <returns>流量数据集合</returns>
        public virtual List <List <TrafficChart <DateTime, int, LaneFlow> > > QueryCharts(List <Lane> lanes, DateTimeLevel level, DateTime[] startTimes, DateTime[] endTimes, DateTime baseTime, FlowType[] flowTypes = null)
        {
            List <List <TrafficChart <DateTime, int, LaneFlow> > > result = new List <List <TrafficChart <DateTime, int, LaneFlow> > >();
            HashSet <string> dataIds = lanes.Select(l => l.DataId).ToHashSet();

            for (int i = 0; i < startTimes.Length; ++i)
            {
                List <TrafficChart <DateTime, int, LaneFlow> > item = new List <TrafficChart <DateTime, int, LaneFlow> >();
                foreach (IQueryable <LaneFlow> queryable in BranchDbConvert.GetQuerables(startTimes[i], endTimes[i], _flowContext.Queryable(level)))
                {
                    item.AddRange(SelectChart(Where(queryable, dataIds, level, startTimes[i], endTimes[i]), level, startTimes[0], startTimes[i], flowTypes));
                }
                result.Add(item);
            }
            return(result);
        }