- Timestamp:
- 01/26/18 08:51:30 (6 years ago)
- Location:
- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs
r15628 r15658 77 77 public IEnumerable<Guid> GetAllGrantedResourceIdsByProjectId(Guid projectId) { 78 78 return DataContext.ExecuteQuery<Guid>(GetAllGrantedResourceIdsByProjectIdQueryString, projectId); 79 } 80 81 public IEnumerable<Resource> GetAllGrantedResourcesByProjectIds(IEnumerable<Guid> projectIds) { 82 string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x))); 83 if (!string.IsNullOrWhiteSpace(paramProjectIds)) { 84 string queryString = string.Format(GetAllGrantedResourcesByProjectIdsQueryString, paramProjectIds); 85 return DataContext.ExecuteQuery<Resource>(queryString); 86 } 87 return Enumerable.Empty<Resource>(); 79 88 } 80 89 … … 173 182 WHERE apr.ProjectId = '{0}' 174 183 "; 184 private const string GetAllGrantedResourcesByProjectIdsQueryString = @" 185 WITH rtree AS 186 ( 187 SELECT ResourceId, ParentResourceId 188 FROM [Resource] 189 UNION ALL 190 SELECT rt.ResourceId, r.ParentResourceId 191 FROM [Resource] r 192 JOIN rtree rt ON rt.ParentResourceId = r.ResourceId 193 ) 194 SELECT res.* 195 FROM rtree, [AssignedProjectResource] apr, [Resource] res 196 WHERE rtree.ParentResourceId = apr.ResourceId 197 AND rtree.ResourceId = res.ResourceId 198 AND apr.ProjectId IN ({0}) 199 UNION 200 SELECT res.* 201 FROM [AssignedProjectResource] apr, [Resource] res 202 WHERE apr.ResourceId = res.ResourceId 203 AND apr.ProjectId IN ({0}) 204 "; 175 205 private const string GetAllGrantedResourceIdsOfOwnedParentProjectsQueryString = @" 176 206 WITH pbranch AS -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
r15644 r15658 110 110 <Compile Include="Daos\HiveStatistics\DimClientDao.cs" /> 111 111 <Compile Include="Daos\HiveStatistics\DimJobDao.cs" /> 112 <Compile Include="Daos\HiveStatistics\DimProjectDao.cs" /> 112 113 <Compile Include="Daos\HiveStatistics\DimTimeDao.cs" /> 113 114 <Compile Include="Daos\HiveStatistics\DimUserDao.cs" /> 114 115 <Compile Include="Daos\HiveStatistics\FactClientInfoDao.cs" /> 116 <Compile Include="Daos\HiveStatistics\FactProjectInfoDao.cs" /> 115 117 <Compile Include="Daos\HiveStatistics\FactTaskDao.cs" /> 116 118 <Compile Include="Daos\JobDao.cs" />
Note: See TracChangeset
for help on using the changeset viewer.