| | |
| | | |
| | | #endregion |
| | | |
| | | #region Query |
| | | #region Get |
| | | |
| | | /// <summary> |
| | | /// 查询全部 |
| | | /// </summary> |
| | | public List<Entity.LogicTree> QueryAll(long projectId) |
| | | public List<Entity.LogicTree> GetAll(long projectId) |
| | | { |
| | | if (projectId < 1) |
| | | return default; |
| | | var path = GetFolderPath(projectId); |
| | | var all = FileIdHelper<Entity.LogicTree>.QueryAll(path); |
| | | var all = FileIdHelper<Entity.LogicTree>.GetAll(path); |
| | | var entities = all?.OrderBy(x => x.SortCode).ToList(); |
| | | return entities; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 根据 Id查询 |
| | | /// </summary> |
| | | public Entity.LogicTree QueryById(long projectId, long Id) |
| | | public Entity.LogicTree 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); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 根据 Id集合查询 |
| | | /// </summary> |
| | | public List<Entity.LogicTree> QueryByIds(long projectId, IEnumerable<long> Ids) |
| | | public List<Entity.LogicTree> 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; |
| | | } |