From f51adcc8cbbf202faefc1fa1bce5efa4097b6166 Mon Sep 17 00:00:00 2001 From: kittapath Date: Thu, 17 Oct 2024 22:24:25 +0700 Subject: [PATCH] no message --- src/controllers/PositionController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index d9339494..9608bca7 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -4069,7 +4069,7 @@ export class PositionController extends Controller { }, ) { let conditionGroup = ""; - if (body.type.trim().toUpperCase() == "GROUP1") { + if (body.type.trim().toUpperCase() == "GROUP1.1") { conditionGroup = "(posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'ชำนาญงาน') OR (posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'ปฏิบัติงาน') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ปฏิบัติการ') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ชำนาญการ')"; } else if (body.type.trim().toUpperCase() == "GROUP1.2") { @@ -4094,7 +4094,9 @@ export class PositionController extends Controller { .leftJoinAndSelect("positions.posType", "posType") .leftJoinAndSelect("positions.posLevel", "posLevel") .leftJoinAndSelect("posMaster.orgRevision", "orgRevision") - .andWhere("posMaster.orgRootId = :orgRootId", { orgRootId: body.rootId }) + .andWhere("posMaster.orgRootId LIKE :orgRootId", { + orgRootId: body.type.trim().toUpperCase() == "GROUP1" ? body.rootId : `%%`, + }) .andWhere("posMaster.statusReport = :statusReport", { statusReport: "PENDING" }) .andWhere("posMaster.next_holderId IS NOT NULL") .andWhere("orgRevision.orgRevisionIsCurrent = :orgRevisionIsCurrent", {