From 32bb7e3b79ebd3901365b1952d1b7191dd28355c Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 4 Mar 2025 17:51:57 +0700 Subject: [PATCH] updated condition position & salary --- src/controllers/ProfileSalaryController.ts | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index b6d95842..5780e4fc 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -19,7 +19,7 @@ import HttpError from "../interfaces/http-error"; import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory"; import { RequestWithUser } from "../middlewares/user"; import { Profile } from "../entities/Profile"; -import { LessThan, MoreThan } from "typeorm"; +import { In, LessThan, MoreThan } from "typeorm"; import permission from "../interfaces/permission"; import { setLogDataDiff } from "../interfaces/utils"; @Route("api/v1/org/profile/salary") @@ -62,7 +62,7 @@ export class ProfileSalaryController extends Controller { if (_workflow == false) await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId); const record = await this.salaryRepo.find({ - where: { profileId: profileId }, + where: { profileId: profileId, commandCode: In(["5", "6", "7"]) }, order: { order: "ASC" }, }); return new HttpSuccess(record); @@ -74,7 +74,25 @@ export class ProfileSalaryController extends Controller { if (_workflow == false) await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId); const record = await this.salaryRepo.find({ - where: { profileId: profileId }, + where: { + profileId: profileId, + commandCode: In([ + "0", + "9", + "1", + "2", + "3", + "4", + "8", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + ]), + }, order: { order: "ASC" }, }); return new HttpSuccess(record);