เพิ่มค้นหาประเภทการพ้นจากราชการ issue #1239

This commit is contained in:
Bright 2025-01-30 18:19:50 +07:00
parent 024549ef3e
commit cf5b36b94c
2 changed files with 13 additions and 7 deletions

View file

@ -4609,6 +4609,7 @@ export class ProfileController extends Controller {
@Query() node?: number,
@Query() nodeId?: string,
@Query() isAll?: boolean,
@Query() retireType?: string,
) {
let _data = await new permission().PermissionOrgList(request, "SYS_REGISTRY_OFFICER");
let queryLike =
@ -4742,9 +4743,11 @@ export class ProfileController extends Controller {
.andWhere(
isRetire != undefined && isRetire != null
? isRetire == false
? `profile.dateLeave IS null`
: `profile.dateLeave IS NOT NULL`
: "1=1",
? `profile.dateLeave IS NULL`
: isRetire == true && retireType != undefined && retireType != null
? `profile.dateLeave IS NOT NULL AND profile.leaveType = '${retireType}'`
: `profile.dateLeave IS NOT NULL`
: "1=1"
)
.andWhere(nodeCondition, {
nodeId: nodeId,

View file

@ -1488,6 +1488,7 @@ export class ProfileEmployeeController extends Controller {
@Query() node?: number,
@Query() nodeId?: string,
@Query() isAll?: boolean,
@Query() retireType?: string,
) {
let _data = await new permission().PermissionOrgList(request, "SYS_REGISTRY_EMP");
let queryLike =
@ -1620,10 +1621,12 @@ export class ProfileEmployeeController extends Controller {
)
.andWhere(
isRetire != undefined && isRetire != null
? isRetire == true
? `profile.dateRetire IS null`
: `profile.dateRetire IS NOT NULL`
: "1=1",
? isRetire == false
? `profile.dateLeave IS NULL`
: isRetire == true && retireType != undefined && retireType != null
? `profile.dateLeave IS NOT NULL AND profile.leaveType = '${retireType}'`
: `profile.dateLeave IS NOT NULL`
: "1=1"
)
.andWhere("profileEmployee.employeeClass LIKE :type", {
type: "PERM",