Fix ระบบทะเบียนประวัติ (ลูกจ้างชั่วคราว) >> ค้นหารายชื่อลูกจ้างชั่วคราว #1647
This commit is contained in:
parent
bda80475d1
commit
ffb9ea327d
1 changed files with 25 additions and 19 deletions
|
|
@ -1589,31 +1589,37 @@ export class ProfileEmployeeTempController extends Controller {
|
|||
keyword2: `${posLevel}`,
|
||||
},
|
||||
)
|
||||
// .andWhere(
|
||||
// isProbation != undefined && isProbation != null
|
||||
// ? `profileEmployee.isProbation = ${isProbation}`
|
||||
// : "1=1",
|
||||
// )
|
||||
// .andWhere(
|
||||
// isRetire != undefined && isRetire != null
|
||||
// ? isRetire == true
|
||||
// ? `profileEmployee.dateRetire IS null`
|
||||
// : `profileEmployee.dateRetire IS NOT NULL`
|
||||
// : "1=1",
|
||||
// )
|
||||
.andWhere(
|
||||
"profileEmployee.employeeClass = :type", {
|
||||
type: type ? type.trim().toLocaleUpperCase() : "TEMP"
|
||||
}
|
||||
)
|
||||
.orWhere(
|
||||
`current_holderTemps.orgRootId is null AND current_holderTemps.orgChild1Id is null AND
|
||||
current_holderTemps.orgChild2Id is null AND current_holderTemps.orgChild3Id is null AND
|
||||
current_holderTemps.orgChild4Id is null AND profileEmployee.createdUserId = :keycloak AND
|
||||
profileEmployee.employeeClass = :type`, {
|
||||
keycloak: request.user.sub,
|
||||
type: type ? type.trim().toLocaleUpperCase() : "TEMP",
|
||||
}
|
||||
new Brackets((qb) => {
|
||||
if (!searchKeyword) {
|
||||
qb.andWhere(
|
||||
`current_holderTemps.orgRootId is null AND current_holderTemps.orgChild1Id is null AND
|
||||
current_holderTemps.orgChild2Id is null AND current_holderTemps.orgChild3Id is null AND
|
||||
current_holderTemps.orgChild4Id is null AND profileEmployee.createdUserId = :keycloak AND
|
||||
profileEmployee.employeeClass = :type
|
||||
`,
|
||||
{
|
||||
keycloak: request.user.sub,
|
||||
type: type ? type.trim().toLocaleUpperCase() : "TEMP"
|
||||
}
|
||||
)
|
||||
}
|
||||
else {
|
||||
qb.andWhere(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? queryLike
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
)
|
||||
}
|
||||
}),
|
||||
)
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue