From 15db387e7a299a4a7354837dc5e4ca8b20a69435 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 29 Nov 2024 16:53:05 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20#813?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileController.ts | 12 ++++++++---- src/controllers/ProfileEmployeeController.ts | 10 +++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index cfea4ea2..1f42706b 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -4100,10 +4100,6 @@ export class ProfileController extends Controller { IFNULL(orgRoot.orgRootShortName, ''), IFNULL(current_holders.posMasterNo , '') ) LIKE :keyword`; - // queryLike = `CONCAT( - // IFNULL(orgRoot.orgRootShortName, ''), - // IFNULL(current_holders.posMasterNo , '') - // ) LIKE :keyword`; } let nodeCondition = "1=1"; let nodeAll = ""; @@ -7021,6 +7017,14 @@ export class ProfileController extends Controller { keyword: `%${body.keyword}%`, }, ) + .orWhere( + body.keyword != null && body.keyword != "" + ? "CONCAT(current_holder.prefix,current_holder.firstName,' ',current_holder.lastName) LIKE :keyword" + : "1=1", + { + keyword: `%${body.keyword}%`, + }, + ) .orWhere( body.keyword != null && body.keyword != "" ? "current_holder.position LIKE :keyword" diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index dd14cf4c..1ea3919e 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -2891,6 +2891,14 @@ export class ProfileEmployeeController extends Controller { keyword: `%${body.keyword}%`, }, ) + .orWhere( + body.keyword != null && body.keyword != "" + ? "CONCAT(current_holder.prefix,current_holder.firstName,' ',current_holder.lastName) LIKE :keyword" + : "1=1", + { + keyword: `%${body.keyword}%`, + }, + ) .orWhere( body.keyword != null && body.keyword != "" ? "current_holder.position LIKE :keyword" @@ -2918,7 +2926,7 @@ export class ProfileEmployeeController extends Controller { ) .orWhere( body.keyword != null && body.keyword != "" - ? "posLevel.posLevelName LIKE :keyword" + ? "CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) LIKE :keyword" : "1=1", { keyword: `%${body.keyword}%`,