From aa7dd54230cbb2558a3a6e51d4da4b895c9a9d59 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 13 May 2024 11:33:22 +0700 Subject: [PATCH] =?UTF-8?q?filter=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80?= =?UTF-8?q?=E0=B8=A0=E0=B8=97=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileEmployeeController.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 96e64d34..6134d718 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -199,6 +199,7 @@ export class ProfileEmployeeController extends Controller { @Query() yearLeave?: number, @Query() isProbation?: boolean, @Query() isRetire?: boolean, + @Query() type?: string, ) { let queryLike = "CONCAT(profileEmployee.prefix, profileEmployee.firstName, ' ', profileEmployee.lastName) LIKE :keyword"; @@ -254,6 +255,14 @@ export class ProfileEmployeeController extends Controller { : `profile.dateRetire IS NOT NULL` : "1=1", ) + .andWhere( + type !== undefined && type !== null && type !== "" + ? "profileEmployee.employeeClass LIKE :type" + : "1=1", + { + type: `%${type}%`, + } + ) .skip((page - 1) * pageSize) .take(pageSize) .getManyAndCount();