- Timestamp:
- 11/28/18 22:21:11 (6 years ago)
- Location:
- branches/2915-AbsoluteSymbol
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2915-AbsoluteSymbol
-
branches/2915-AbsoluteSymbol/HeuristicLab.Services.Hive.DataAccess
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Hive.DataAccess merged: 16257
- Property svn:mergeinfo changed
-
branches/2915-AbsoluteSymbol/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs
r16240 r16332 41 41 public void DeleteByIds(IEnumerable<Guid> ids) { 42 42 string paramProjectIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x))); 43 if (!string.IsNullOrWhiteSpace(paramProjectIds)) {43 if (!string.IsNullOrWhiteSpace(paramProjectIds)) { 44 44 string queryString = string.Format(DeleteByIdsQueryString, paramProjectIds); 45 45 DataContext.ExecuteCommand(queryString); … … 117 117 WITH rtree AS 118 118 ( 119 SELECT ResourceId, ParentResourceId 120 FROM [Resource] 121 UNION ALL 122 SELECT rt.ResourceId, r.ParentResourceId 123 FROM [Resource] r 124 JOIN rtree rt ON rt.ParentResourceId = r.ResourceId 125 ) 126 SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory 127 FROM rtree, [AssignedProjectResource] apr, [Resource] res 128 WHERE rtree.ResourceId = res.ResourceId 129 AND res.ResourceType = 'Slave' 130 AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating') 131 AND rtree.ParentResourceId = apr.ResourceId 132 GROUP BY apr.ProjectId 133 UNION 134 SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory 135 FROM [AssignedProjectResource] apr, [Resource] res 136 WHERE apr.ResourceId = res.ResourceId 137 AND res.ResourceType = 'Slave' 138 AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating') 139 GROUP BY apr.ProjectId 119 SELECT ResourceId, ParentResourceId 120 FROM [Resource] 121 UNION ALL 122 SELECT rt.ResourceId, r.ParentResourceId 123 FROM [Resource] r 124 JOIN rtree rt ON rt.ParentResourceId = r.ResourceId 125 ) 126 SELECT [union].ProjectId, SUM([union].Cores), SUM([union].Memory) 127 FROM 128 ( 129 SELECT apr.ProjectId, res.Cores, res.Memory 130 FROM rtree, [AssignedProjectResource] apr, [Resource] res 131 WHERE rtree.ResourceId = res.ResourceId 132 AND res.ResourceType = 'Slave' 133 AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating') 134 AND rtree.ParentResourceId = apr.ResourceId 135 UNION ALL 136 SELECT apr.ProjectId, res.Cores, res.Memory 137 FROM [AssignedProjectResource] apr, [Resource] res 138 WHERE apr.ResourceId = res.ResourceId 139 AND res.ResourceType = 'Slave' 140 AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating') 141 ) AS [union] 142 GROUP BY [union].ProjectId 140 143 "; 141 144
Note: See TracChangeset
for help on using the changeset viewer.