update viewEmpPosMater
This commit is contained in:
parent
434293418d
commit
52e1c635a1
1 changed files with 10 additions and 2 deletions
|
|
@ -87,8 +87,16 @@ import { ViewColumn, ViewEntity } from "typeorm";
|
|||
WHERE pd2.profileId = pd1.profileId
|
||||
)
|
||||
) AS profileDiscipline ON profileDiscipline.profileId = profileEmployee.id
|
||||
LEFT JOIN
|
||||
profileLeave ON profileLeave.profileId = profileEmployee.id
|
||||
LEFT JOIN (
|
||||
SELECT pl1.*
|
||||
FROM profileLeave pl1
|
||||
INNER JOIN (
|
||||
SELECT profileId, MAX(createdAt) AS maxDate
|
||||
FROM profileLeave
|
||||
GROUP BY profileId
|
||||
) pl2 ON pl1.profileId = pl2.profileId
|
||||
AND pl1.createdAt = pl2.maxDate
|
||||
) AS profileLeave ON profileLeave.profileId = employeePosMaster.current_holderId
|
||||
LEFT JOIN
|
||||
profileAssessment ON profileAssessment.profileId = profileEmployee.id
|
||||
LEFT JOIN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue