diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 61df770a..fda8bd44 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -855,12 +855,11 @@ export class PositionController extends Controller { .leftJoinAndSelect('posMaster.current_holder', 'current_holder') .leftJoinAndSelect('posMaster.next_holder', 'next_holder') .where(conditions) - // .orWhere('(current_holder.prefix LIKE :keyword OR current_holder.firstName LIKE :keyword OR current_holder.lastName LIKE :keyword)', { keyword: `%${body.keyword}%` }) .orWhere( new Brackets((qb) => { qb.where( body.keyword != null && body.keyword != "" - ? "current_holder.prefix LIKE :keyword OR current_holder.firstName LIKE :keyword OR current_holder.lastName LIKE :keyword OR :keyword LIKE current_holder.prefix OR :keyword LIKE current_holder.firstName OR :keyword LIKE current_holder.lastName" + ? "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", { keyword: `%${body.keyword}%`,