แก้ไขค้นหาชื่อคนครอง master/list

This commit is contained in:
AdisakKanthawilang 2024-03-01 11:17:57 +07:00
parent 21aa51ff99
commit ba76e787b0

View file

@ -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)