This commit is contained in:
parent
384d637610
commit
7dd99ac07b
1 changed files with 245 additions and 6 deletions
|
|
@ -180,6 +180,81 @@ export class ProfileSalaryTempController extends Controller {
|
|||
? `posLevel.posLevelName like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgRoot.orgRootName like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild1.orgChild1Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild2.orgChild2Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild3.orgChild3Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild4.orgChild4Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName,
|
||||
orgChild4.orgChild4ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
|
|
@ -466,13 +541,177 @@ export class ProfileSalaryTempController extends Controller {
|
|||
// .andWhere("profileEmployee.employeeClass LIKE :type", {
|
||||
// type: "PERM",
|
||||
// })
|
||||
// .andWhere(
|
||||
// searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
// ? queryLike
|
||||
// : "1=1",
|
||||
// {
|
||||
// keyword: `%${searchKeyword}%`,
|
||||
// },
|
||||
// )
|
||||
.andWhere(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? queryLike
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
new Brackets((qb) => {
|
||||
qb.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `profileEmployee.citizenId like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `profileEmployee.position like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(profileEmployee.prefix, profileEmployee.firstName," ",profileEmployee.lastName) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `posType.posTypeName like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `posLevel.posLevelName like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(posType.posTypeShortName," ",posLevel.posLevelName) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(posType.posTypeShortName,posLevel.posLevelName) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgRoot.orgRootName like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild1.orgChild1Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild2.orgChild2Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild3.orgChild3Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `orgChild4.orgChild4Name like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName,
|
||||
orgChild4.orgChild4ShortName," ",
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName,
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != null && searchKeyword != ""
|
||||
? `CONCAT(
|
||||
orgRoot.orgRootShortName,
|
||||
orgChild1.orgChild1ShortName,
|
||||
orgChild2.orgChild2ShortName,
|
||||
orgChild3.orgChild3ShortName,
|
||||
orgChild4.orgChild4ShortName,
|
||||
current_holders.posMasterNo
|
||||
) like '%${searchKeyword}%'`
|
||||
: "1=1",
|
||||
);
|
||||
}),
|
||||
)
|
||||
.andWhere("current_holders.orgRootId = :rootId", {
|
||||
rootId: rootId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue