/// <summary> /// 获取小区信息 /// </summary> /// <param name="neType">网络制式</param> /// <param name="conditions">条件集合</param> /// <returns></returns> private IEnumerable <NeCell> GetNeCellBySQL(NetType neType, string sql) { using (var context = UnitOfWork.Get(neType, DataBaseType.Normal)) { var rep = new NeRepository(context); return(rep.GetNeCellsBySql(sql)); } }
/// <summary> /// 获取全网小区数量 /// </summary> /// <param name="netType"></param> /// <returns></returns> public int GeStaticCellAllCount(NetType netType) { using (var context = UnitOfWork.Get(netType, DataBaseType.Normal)) { var q = new NeRepository(context).GetNeCells().Count(); return(q); } }
public List <NeCell> GetBasicNeCellByIds(NetType neType, List <string> neCellIds) { using (var context = UnitOfWork.Get(neType, DataBaseType.Normal)) { using (var r = new NeRepository(context)) { return(r.GetNeCells().Where(t => neCellIds.Contains(t.NeCellID)).ToList()); } } }
public NeCell GetBasicNeCellById(NetType neType, string neCellId) { using (var context = UnitOfWork.Get(neType, DataBaseType.Normal)) { using (var r = new NeRepository(context)) { return(r.GetNeCellById(neCellId)); } } }
/// <summary> /// 统计城市扇区数量 /// </summary> /// <param name="netType">制式</param> /// <returns></returns> public List <Pair> GetStaticNeCellCityCount(NetType netType) { using (var context = UnitOfWork.Get(netType, DataBaseType.Normal)) { var q = new NeRepository(context).GetNeCells(); var q1 = from p in q group p by p.CityID into g select new Pair { First = g.Key, Second = g.Count() }; return(q1.ToList()); } }
/// <summary> /// 根据场景获取小区 /// </summary> /// <param name="netType"></param> /// <param name="cellConditions"></param> /// <param name="groupConditions"></param> /// <param name="pagination"></param> /// <returns></returns> public DataSourceResult GetCellByGroup(NetType netType, DataSourceRequest request) { using (var context = UnitOfWork.Get(netType, DataBaseType.Normal)) { using (var r = new NeRepository(context)) { var ner = new NeGroupItemRepository(context); var q = from ne in r.GetBasicNeCell() join tg in ner.GetNeGroupItems().Where(request.Filters) on ne.NeCellID equals tg.NeSysID select ne; return(q.ToDataSourceResult <NeCell, NeCell>(request.Sorts, request.Groups, request.Aggregates, request.Page, request.PageSize, null)); } } }
/// <summary> /// 根据场景获取小区 /// </summary> /// <param name="netType"></param> /// <param name="cellConditions"></param> /// <param name="groupConditions"></param> /// <param name="pagination"></param> /// <returns></returns> public List <NeCell> GetCellByGroup(NetType netType, IList <IFilterDescriptor> filters) { using (var context = UnitOfWork.Get(netType, DataBaseType.Normal)) { using (var r = new NeRepository(context)) { var ner = new NeGroupItemRepository(context); var q = from ne in r.GetBasicNeCell() join tg in ner.GetNeGroupItems().Where(filters) on ne.NeCellID equals tg.NeSysID select ne; return(q.ToList()); } } }
/// <summary> /// 获取厂家编码,根据查询级别 /// </summary> /// <param name="netType">制式</param> /// <param name="neRelateionInfo">关联关系</param> /// <param name="extensionNeRelation">拓展关系</param> /// <param name="neWhere">条件</param> /// <returns></returns> public string[] GetNeVendorCodesByQueryLevel(NetType netType, string table, string neWhere) { if (string.IsNullOrWhiteSpace(neWhere)) { neWhere = "1=1"; } var sql = string.Format("select distinct a.vendor from ({0}) a where {1}", table, neWhere); //string sql = string.Empty; //if (extensionNeRelation != null && extensionNeRelation.Dest_Value != "-1" && !string.IsNullOrWhiteSpace(extensionNeRelation.ExtensionTableView)) //{ // ; //} //else //{ // sql = string.Format(@" select distinct vendor from {0} where {1} ", neRelateionInfo.BaseDataTableName, neWhere); //} using (var context = UnitOfWork.Get(netType, DataBaseType.Normal)) { var dt = new NeRepository(context).GetVendorsBySql(sql); IList <string> vendors = new List <string>(); if (dt != null && dt.Rows.Count != 0) { //return dt.AsEnumerable().Select(p => p[0].ToString()).ToArray(); foreach (DataRow dr in dt.Rows) { if (dr[0] != null) { vendors.Add(dr[0].ToString()); } } } return(vendors.ToArray()); } }