From 6e84a46ac3c656e049470da22ccc584d0e2d267c Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 20 Feb 2024 17:50:02 +0700 Subject: [PATCH] no message --- src/controllers/PositionController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index c7550f9e..ea6cefba 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1001,10 +1001,10 @@ export class PositionController extends Controller { .leftJoinAndSelect("posMaster.current_holder", "current_holder") .leftJoinAndSelect("posMaster.next_holder", "next_holder") .where(conditions) - // .where("posMaster.orgRevisionId = :revisionId", { revisionId: body.revisionId }) + // // .where("posMaster.orgRevisionId = :revisionId", { revisionId: body.revisionId }) .orWhere( new Brackets((qb) => { - qb.where(searchShortName) + qb.andWhere(body.keyword != null && body.keyword != "" ? searchShortName : "1=1") .andWhere(checkChildConditions) .andWhere(typeCondition) .andWhere(revisionCondition); @@ -1012,7 +1012,7 @@ export class PositionController extends Controller { ) .orWhere( new Brackets((qb) => { - qb.where( + qb.andWhere( body.keyword != null && body.keyword != "" ? "CONCAT(current_holder.prefix, current_holder.firstName, current_holder.lastName) LIKE :keyword OR :keyword LIKE current_holder.prefix OR :keyword LIKE current_holder.firstName OR :keyword LIKE current_holder.lastName " : "1=1",