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",