ningshuxia
2023-02-24 1e4b358de58e36bfbf692ab2538ff9e7d60fd025
DAL/Local/IStation.DAL.LocalFile.Monitor/monitor_point/MonitorPointMapping.cs
@@ -27,17 +27,17 @@
        #endregion
        #region Query
        #region Get
        /// <summary>
        /// 查询全部
        /// </summary> 
        public List<Entity.MonitorPointMapping> QueryAll(long projectId)
        public List<Entity.MonitorPointMapping> GetAll(long projectId)
        {
            if (projectId < 1)
                return default;
            var path = GetFolderPath(projectId);
            var all = FileIdHelper<Entity.MonitorPointMapping>.QueryAll(path);
            var all = FileIdHelper<Entity.MonitorPointMapping>.GetAll(path);
            var entities = all?.OrderBy(x => x.SortCode).ToList();
            return entities;
        }
@@ -45,13 +45,13 @@
        /// <summary>
        /// 根据 Id查询
        /// </summary> 
        public Entity.MonitorPointMapping QueryById(long projectId, long Id)
        public Entity.MonitorPointMapping GetById(long projectId, long Id)
        {
            if (projectId < 1)
                return default;
            if (Id < 0)
                return default;
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            var entities = all?.ToList();
            return entities?.Find(t => t.Id == Id);
        }
@@ -59,13 +59,13 @@
        /// <summary>
        /// 根据 Id集合查询
        /// </summary> 
        public List<Entity.MonitorPointMapping> QueryByIds(long projectId, IEnumerable<long> Ids)
        public List<Entity.MonitorPointMapping> GetByIds(long projectId, IEnumerable<long> Ids)
        {
            if (projectId < 1)
                return default;
            if (Ids == null || Ids.Count() < 1)
                return default;
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            var entities = all?.Where(x => Ids.Contains(x.Id)).ToList();
            return entities;
        }
@@ -73,13 +73,13 @@
        /// <summary>
        /// 根据 MonitorPointId 查询
        /// </summary> 
        public List<Entity.MonitorPointMapping> QueryByMonitorPointId(long projectId, long monitorPointId)
        public List<Entity.MonitorPointMapping> GetByMonitorPointId(long projectId, long monitorPointId)
        {
            if (projectId < 1)
                return default;
            if (monitorPointId < 0)
                return default;
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            var entities = all?.Where(x => x.MonitorPointId == monitorPointId).ToList();
            return entities;
        }
@@ -87,13 +87,13 @@
        /// <summary>
        ///根据 ObjectType 和 ObjectId 查询
        /// </summary> 
        public List<Entity.MonitorPointMapping> QueryByObjectTypeAndObjectId(long projectId, string objectType, long objectId)
        public List<Entity.MonitorPointMapping> GetByObjectTypeAndObjectId(long projectId, string objectType, long objectId)
        {
            if (projectId < 1)
                return default;
            if (objectId < 0)
                return default;
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            var entities = all?.Where(x => x.ObjectType == objectType && x.ObjectId == objectId).ToList();
            return entities;
        }
@@ -107,7 +107,7 @@
                return default;
            if (objectIds == null || objectIds.Count() < 1)
                return default;
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            var entities = all?.Where(x => x.ObjectType == objectType && objectIds.Contains(x.ObjectId)).ToList();
            return entities;
        }
@@ -125,7 +125,7 @@
            {
                return DeleteByObjectTypeAndObjectId(projectId, objectType, objectId);
            }
            var all = QueryAll(projectId);
            var all = GetAll(projectId);
            if (all == null)
                all = new List<Entity.MonitorPointMapping>();
            all.RemoveAll(x => x.ObjectType == objectType && x.ObjectId == objectId);
@@ -312,7 +312,7 @@
            if (monitorPointId < 0)
                return default;
            var path = GetFolderPath(projectId);
            var list = QueryByMonitorPointId(projectId, monitorPointId);
            var list = GetByMonitorPointId(projectId, monitorPointId);
            if (list != null && list.Count > 0)
            {
                var Ids = list.Select(x => x.Id);
@@ -331,7 +331,7 @@
            if (objectId < 0)
                return default;
            var path = GetFolderPath(projectId);
            var list = QueryByObjectTypeAndObjectId(projectId, objectType, objectId);
            var list = GetByObjectTypeAndObjectId(projectId, objectType, objectId);
            if (list != null && list.Count > 0)
            {
                var Ids = list.Select(x => x.Id);