diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 614a56b1..16ca8fb4 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1096,6 +1096,21 @@ export class PositionController extends Controller { .andWhere(revisionCondition); }), ) + .orWhere( + new Brackets((qb) => { + qb.andWhere( + body.keyword != null && body.keyword != "" + ? `CONCAT(next_holder.prefix, next_holder.firstName, next_holder.lastName) like '%${body.keyword}%'` + : "1=1", + { + keyword: `%${body.keyword}%`, + }, + ) + .andWhere(checkChildConditions) + .andWhere(typeCondition) + .andWhere(revisionCondition); + }), + ) .orderBy("posMaster.posMasterOrder", "ASC") .skip((body.page - 1) * body.pageSize) .take(body.pageSize)