This commit is contained in:
AdisakKanthawilang 2024-12-19 20:01:31 +07:00
parent 9e4f18a1d6
commit d5d65db580
2 changed files with 19 additions and 0 deletions

View file

@ -1087,6 +1087,9 @@ export class EmployeePositionController extends Controller {
.leftJoinAndSelect("posMaster.current_holder", "current_holder")
.leftJoinAndSelect("posMaster.next_holder", "next_holder")
.leftJoinAndSelect("posMaster.orgRevision", "orgRevision")
.leftJoinAndSelect("posMaster.positions", "positions")
.leftJoinAndSelect("positions.posType", "posType")
.leftJoinAndSelect("positions.posLevel", "posLevel")
.where(conditions)
.orWhere(
new Brackets((qb) => {
@ -1132,6 +1135,21 @@ export class EmployeePositionController extends Controller {
.andWhere(revisionCondition);
}),
)
.orWhere(
new Brackets((qb) => {
qb.andWhere(
body.keyword != null && body.keyword != ""
? `CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) 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)

View file

@ -864,6 +864,7 @@ export class ProfileEmployeeTempController extends Controller {
}
Object.assign(record, body);
record.prefixMain = record.prefix;
record.createdUserId = request.user.sub;
record.createdFullName = request.user.name;
record.createdAt = new Date();