#2231
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s

This commit is contained in:
Adisak 2026-01-26 14:14:58 +07:00
parent 78778e0eb0
commit 6e6253887f

View file

@ -547,6 +547,11 @@ export class KeycloakController extends Controller {
.createQueryBuilder("profile") .createQueryBuilder("profile")
.leftJoinAndSelect("profile.roleKeycloaks", "roleKeycloaks") .leftJoinAndSelect("profile.roleKeycloaks", "roleKeycloaks")
.leftJoinAndSelect("profile.current_holders", "current_holders") .leftJoinAndSelect("profile.current_holders", "current_holders")
.leftJoinAndSelect("current_holders.orgRoot", "orgRoot")
.leftJoinAndSelect("current_holders.orgChild1", "orgChild1")
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.where("profile.keycloak IS NOT NULL AND profile.keycloak != ''") .where("profile.keycloak IS NOT NULL AND profile.keycloak != ''")
.andWhere(checkChildFromRole) .andWhere(checkChildFromRole)
.andWhere(conditions) .andWhere(conditions)
@ -566,6 +571,13 @@ export class KeycloakController extends Controller {
}), }),
) )
.orderBy("profile.citizenId", "ASC") .orderBy("profile.citizenId", "ASC")
.orderBy("orgRoot.orgRootOrder", "ASC")
.addOrderBy("orgChild1.orgChild1Order", "ASC")
.addOrderBy("orgChild2.orgChild2Order", "ASC")
.addOrderBy("orgChild3.orgChild3Order", "ASC")
.addOrderBy("orgChild4.orgChild4Order", "ASC")
.addOrderBy("current_holders.posMasterOrder", "ASC")
.addOrderBy("current_holders.posMasterCreatedAt", "ASC")
.skip((body.page - 1) * body.pageSize) .skip((body.page - 1) * body.pageSize)
.take(body.pageSize) .take(body.pageSize)
.getManyAndCount(); .getManyAndCount();
@ -574,6 +586,11 @@ export class KeycloakController extends Controller {
.createQueryBuilder("profileEmployee") .createQueryBuilder("profileEmployee")
.leftJoinAndSelect("profileEmployee.roleKeycloaks", "roleKeycloaks") .leftJoinAndSelect("profileEmployee.roleKeycloaks", "roleKeycloaks")
.leftJoinAndSelect("profileEmployee.current_holders", "current_holders") .leftJoinAndSelect("profileEmployee.current_holders", "current_holders")
.leftJoinAndSelect("current_holders.orgRoot", "orgRoot")
.leftJoinAndSelect("current_holders.orgChild1", "orgChild1")
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.where("profileEmployee.keycloak IS NOT NULL AND profileEmployee.keycloak != ''") .where("profileEmployee.keycloak IS NOT NULL AND profileEmployee.keycloak != ''")
.andWhere(checkChildFromRole) .andWhere(checkChildFromRole)
.andWhere(conditions) .andWhere(conditions)
@ -598,6 +615,13 @@ export class KeycloakController extends Controller {
}), }),
) )
.orderBy("profileEmployee.citizenId", "ASC") .orderBy("profileEmployee.citizenId", "ASC")
.orderBy("orgRoot.orgRootOrder", "ASC")
.addOrderBy("orgChild1.orgChild1Order", "ASC")
.addOrderBy("orgChild2.orgChild2Order", "ASC")
.addOrderBy("orgChild3.orgChild3Order", "ASC")
.addOrderBy("orgChild4.orgChild4Order", "ASC")
.addOrderBy("current_holders.posMasterOrder", "ASC")
.addOrderBy("current_holders.posMasterCreatedAt", "ASC")
.skip((body.page - 1) * body.pageSize) .skip((body.page - 1) * body.pageSize)
.take(body.pageSize) .take(body.pageSize)
.getManyAndCount(); .getManyAndCount();