generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from Ed-Fi-Exchange-OSS/multiple_domain_filters
Multiple domain filters
- Loading branch information
Showing
13 changed files
with
93 additions
and
88 deletions.
There are no files selected for viewing
24 changes: 9 additions & 15 deletions
24
src/API/DatabaseMigrations/scripts/views/vw_StaffObjectiveRatings.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
CREATE OR ALTER VIEW [edfi].[vw_StaffObjectiveRatings] AS | ||
with evaluationRatings as ( | ||
select staff.StaffUSI, | ||
eorr.EvaluationObjectiveTitle as Category | ||
, eorr.Rating | ||
, eorr.EvaluationDate | ||
, Row_number() over (partition by eorr.PersonId, eorr.EvaluationObjectiveTitle order by eorr.EvaluationDate desc, eorr.CreateDate desc) as "Number" | ||
from tpdm.EvaluationElementRatingResult eorr | ||
join edfi.Staff as staff on staff.PersonId = eorr.PersonId | ||
) | ||
Select | ||
staff.StaffUSI | ||
, eorr.EvaluationObjectiveTitle as Category | ||
, Avg(eorr.Rating) as Rating | ||
, Max(eorr.EvaluationDate) as EvaluationDate | ||
From tpdm.EvaluationElementRatingResult eorr | ||
Join edfi.Staff as staff on staff.PersonId = eorr.PersonId | ||
Group by staff.StaffUSI, eorr.EvaluationObjectiveTitle | ||
|
||
select s.StaffUSI | ||
, ratings.Category | ||
, ratings.Rating | ||
|
||
from edfi.Staff as s | ||
join evaluationRatings as ratings on ratings.StaffUSI = s.StaffUSI and ratings.Number = 1 | ||
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.