Skip to content

Commit

Permalink
Merge pull request #1436 from SkillsFundingAgency/QF-558_Sandbox_refresh
Browse files Browse the repository at this point in the history
QF-558
  • Loading branch information
umakanth-g authored Aug 11, 2022
2 parents bca86a0 + 4af4128 commit 2f2a0d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SFA.DAS.AssessorService.Data/SandboxDbRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ SELECT Number+1
FROM CTE
WHERE Number < 9
),
WITH Standards_CTE as(
Standards_CTE as(
SELECT ROW_NUMBER() OVER (PARTITION BY Ifatereferencenumber ORDER BY VersionMajor DESC, VersionMinor DESC) seq, * FROM Standards WHERE LarsCode != 0)
INSERT INTO [Ilrs](Id, CreatedAt, Uln, FamilyName ,GivenNames, UkPrn, StdCode, LearnStartDate, EpaOrgId, FundingModel, ApprenticeshipId, EmployerAccountId, Source, LearnRefNumber, CompletionStatus, EventId, PlannedEndDate)
Expand All @@ -202,11 +202,11 @@ INSERT INTO [Ilrs](Id, CreatedAt, Uln, FamilyName ,GivenNames, UkPrn, StdCode, L
FROM (
SELECT
'1'+ SUBSTRING(ogs.EndPointAssessorOrganisationId,4,4) + RIGHT('000'+CAST(ogs.StandardCode AS VARCHAR(3)),3) +RIGHT('00'+CAST(CTE.Number AS VARCHAR(2)),2) AS Uln,
og1.EndPointAssessorUkprn AS UkPrn,
ogs.EndPointAssessorOrganisationId AS EndPointAssessorOrganisationId,
og1.EndPointAssessorUkprn AS UkPrn,
ogs.EndPointAssessorOrganisationId AS EndPointAssessorOrganisationId,
ogs.StandardCode,
CTE.*,
CONVERT(NUMERIC, JSON_VALUE(sc1.StandardData,'$.Duration')) AS Duration
CTE.*,
TypicalDuration AS Duration
FROM CTE
CROSS JOIN OrganisationStandard ogs
JOIN Organisations og1 ON og1.EndPointAssessorOrganisationId = ogs.EndPointAssessorOrganisationId AND og1.Status <> 'Deleted'
Expand Down

0 comments on commit 2f2a0d6

Please sign in to comment.