permission
This commit is contained in:
parent
4fb493e68c
commit
c55edf33b1
2 changed files with 104 additions and 2 deletions
|
|
@ -358,14 +358,65 @@ export class KpiUserDevelopmentController extends Controller {
|
|||
// evaluating?: boolean | null;
|
||||
},
|
||||
) {
|
||||
await new permission().PermissionList(request, "SYS_RESULT");
|
||||
// await new permission().PermissionList(request, "SYS_RESULT");
|
||||
let conditionFullName =
|
||||
"CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword";
|
||||
let _data = await new permission().PermissionOrgList(request,"SYS_RESULT");
|
||||
const [kpiUserDevelopment, total] = await AppDataSource.getRepository(KpiUserDevelopment)
|
||||
.createQueryBuilder("kpiUserDevelopment")
|
||||
.leftJoinAndSelect("kpiUserDevelopment.kpiUserEvaluation", "kpiUserEvaluation")
|
||||
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
|
||||
.where("kpiUserEvaluation.evaluationStatus = :status", { status: "KP7" })
|
||||
.andWhere(
|
||||
_data.root != undefined && _data.root != null
|
||||
? _data.root[0] != null
|
||||
? `kpiUserEvaluation.orgId IN (:...root)`
|
||||
: `kpiUserEvaluation.orgId is null`
|
||||
: "1=1",
|
||||
{
|
||||
root: _data.root,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child1 != undefined && _data.child1 != null
|
||||
? _data.child1[0] != null
|
||||
? `kpiUserEvaluation.child1Id IN (:...child1)`
|
||||
: `kpiUserEvaluation.child1Id is null`
|
||||
: "1=1",
|
||||
{
|
||||
child1: _data.child1,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child2 != undefined && _data.child2 != null
|
||||
? _data.child2[0] != null
|
||||
? `kpiUserEvaluation.child2Id IN (:...child2)`
|
||||
: `kpiUserEvaluation.child2Id is null`
|
||||
: "1=1",
|
||||
{
|
||||
child2: _data.child2,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child3 != undefined && _data.child3 != null
|
||||
? _data.child3[0] != null
|
||||
? `kpiUserEvaluation.child3Id IN (:...child3)`
|
||||
: `kpiUserEvaluation.child3Id is null`
|
||||
: "1=1",
|
||||
{
|
||||
child3: _data.child3,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child4 != undefined && _data.child4 != null
|
||||
? _data.child4[0] != null
|
||||
? `kpiUserEvaluation.child4Id IN (:...child4)`
|
||||
: `kpiUserEvaluation.child4Id is null`
|
||||
: "1=1",
|
||||
{
|
||||
child4: _data.child4,
|
||||
},
|
||||
)
|
||||
.andWhere("kpiUserEvaluation.kpiPeriodId = :kpiPeriodId", {
|
||||
kpiPeriodId: requestBody.kpiPeriodId,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue