diff --git a/src/controllers/DevelopmentRequestController.ts b/src/controllers/DevelopmentRequestController.ts index d895f1b8..b917c20b 100644 --- a/src/controllers/DevelopmentRequestController.ts +++ b/src/controllers/DevelopmentRequestController.ts @@ -163,6 +163,13 @@ export class DevelopmentRequestController extends Controller { { keyword: `%${keyword}%`, }, + ).orWhere( + keyword != null && keyword != "" + ? "developmentRequest.createdFullName LIKE :keyword" + : "1=1", + { + keyword: `%${keyword}%`, + }, ); }), ) diff --git a/src/controllers/ProfileEditController.ts b/src/controllers/ProfileEditController.ts index c322d09d..b8cec66d 100644 --- a/src/controllers/ProfileEditController.ts +++ b/src/controllers/ProfileEditController.ts @@ -60,6 +60,11 @@ export class ProfileEditController extends Controller { { keyword: `%${keyword}%`, }, + ).orWhere( + keyword != "" && keyword != null ? "ProfileEdit.remark LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, ); }), ) @@ -114,6 +119,17 @@ export class ProfileEditController extends Controller { { keyword: `%${keyword}%`, }, + ).orWhere( + keyword != "" && keyword != null ? "ProfileEdit.remark LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, + ).orWhere( + keyword != "" && keyword != null ? + "CONCAT(profile.prefix, profile.firstName, ' ', profile.lastName) LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, ); }), ) diff --git a/src/controllers/ProfileEditEmployeeController.ts b/src/controllers/ProfileEditEmployeeController.ts index ea82ecc4..64fd1421 100644 --- a/src/controllers/ProfileEditEmployeeController.ts +++ b/src/controllers/ProfileEditEmployeeController.ts @@ -65,6 +65,11 @@ export class ProfileEditEmployeeController extends Controller { { keyword: `%${keyword}%`, }, + ).orWhere( + keyword != "" && keyword != null ? "ProfileEdit.remark LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, ); }), ) @@ -119,6 +124,17 @@ export class ProfileEditEmployeeController extends Controller { { keyword: `%${keyword}%`, }, + ).orWhere( + keyword != "" && keyword != null ? "ProfileEdit.remark LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, + ).orWhere( + keyword != "" && keyword != null ? + "CONCAT(profileEmployee.prefix, profileEmployee.firstName, ' ', profileEmployee.lastName) LIKE :keyword" : "1=1", + { + keyword: `%${keyword}%`, + }, ); }), )