This commit is contained in:
AdisakKanthawilang 2025-05-01 13:14:38 +07:00
parent 3230ace376
commit e71103781c
3 changed files with 20 additions and 6 deletions

View file

@ -320,10 +320,10 @@ export class OrganizationUnauthorizeController extends Controller {
const rootIds = [
"d7e98989-b5ce-47d6-93c3-ab63ed486348",
"e0545eca-5d0a-4a1c-8bbd-e3e25c2521db",
"7ff1fbf2-cc9e-4f53-b83c-334967c27967",
"26989ffa-d5ab-4bbd-ac97-130646cd1da6",
"6f9b30e1-757a-40d5-b053-61eb1b91c0f0",
"eaf65f33-25e9-4956-9dba-5d909f5eb595",
"a3efed2c-3f4b-476d-95e6-9f7e0585ae25",
];
const [findPosMaster, total] = await AppDataSource.getRepository(viewPosMaster)
@ -756,10 +756,10 @@ export class OrganizationUnauthorizeController extends Controller {
const rootIds = [
"d7e98989-b5ce-47d6-93c3-ab63ed486348",
"e0545eca-5d0a-4a1c-8bbd-e3e25c2521db",
"7ff1fbf2-cc9e-4f53-b83c-334967c27967",
"26989ffa-d5ab-4bbd-ac97-130646cd1da6",
"6f9b30e1-757a-40d5-b053-61eb1b91c0f0",
"eaf65f33-25e9-4956-9dba-5d909f5eb595",
"a3efed2c-3f4b-476d-95e6-9f7e0585ae25",
];
const [findPosMaster, total] = await AppDataSource.getRepository(viewEmployeePosMaster)

View file

@ -78,8 +78,15 @@ import { ViewColumn, ViewEntity } from "typeorm";
position ON employeePosMaster.id = position.posMasterId
LEFT JOIN
posExecutive ON position.posExecutiveId = posExecutive.id
LEFT JOIN
profileDiscipline ON profileDiscipline.profileId = profileEmployee.id
LEFT JOIN (
SELECT *
FROM profileDisciplineEmployee pd1
WHERE pd1.date = (
SELECT MAX(pd2.date)
FROM profileDisciplineEmployee pd2
WHERE pd2.profileId = pd1.profileId
)
) AS profileDiscipline ON profileDiscipline.profileId = profileEmployee.id
LEFT JOIN
profileLeave ON profileLeave.profileId = profileEmployee.id
LEFT JOIN

View file

@ -75,8 +75,15 @@ import { ViewColumn, ViewEntity } from "typeorm";
position ON posMaster.id = position.posMasterId
LEFT JOIN
posExecutive ON position.posExecutiveId = posExecutive.id
LEFT JOIN
profileDiscipline ON profileDiscipline.profileId = profile.id
LEFT JOIN (
SELECT *
FROM profileDiscipline pd1
WHERE pd1.date = (
SELECT MAX(pd2.date)
FROM profileDiscipline pd2
WHERE pd2.profileId = pd1.profileId
)
) AS profileDiscipline ON profileDiscipline.profileId = profile.id
LEFT JOIN
profileLeave ON profileLeave.profileId = profile.id
LEFT JOIN