search dna
This commit is contained in:
parent
8f233cbe2e
commit
5c1e691424
2 changed files with 91 additions and 22 deletions
|
|
@ -232,13 +232,19 @@ export class KpiUserEvaluationController extends Controller {
|
|||
let conditionFullName =
|
||||
"CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword";
|
||||
let _data = await new permission().PermissionOrgList(request, "SYS_RESULT");
|
||||
await new CallAPI()
|
||||
.PostData(request, "/org/finddna", _data)
|
||||
.then((x) => {
|
||||
_data = x;
|
||||
})
|
||||
.catch((x) => {});
|
||||
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
|
||||
.createQueryBuilder("kpiUserEvaluation")
|
||||
.andWhere(
|
||||
_data.root != undefined && _data.root != null
|
||||
? _data.root[0] != null
|
||||
? `kpiUserEvaluation.orgId IN (:...root)`
|
||||
: `kpiUserEvaluation.orgId is null`
|
||||
? `kpiUserEvaluation.orgDnaId IN (:...root)`
|
||||
: `kpiUserEvaluation.orgDnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
root: _data.root,
|
||||
|
|
@ -247,8 +253,8 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.andWhere(
|
||||
_data.child1 != undefined && _data.child1 != null
|
||||
? _data.child1[0] != null
|
||||
? `kpiUserEvaluation.child1Id IN (:...child1)`
|
||||
: `kpiUserEvaluation.child1Id is null`
|
||||
? `kpiUserEvaluation.child1DnaId IN (:...child1)`
|
||||
: `kpiUserEvaluation.child1DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child1: _data.child1,
|
||||
|
|
@ -257,8 +263,8 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.andWhere(
|
||||
_data.child2 != undefined && _data.child2 != null
|
||||
? _data.child2[0] != null
|
||||
? `kpiUserEvaluation.child2Id IN (:...child2)`
|
||||
: `kpiUserEvaluation.child2Id is null`
|
||||
? `kpiUserEvaluation.child2DnaId IN (:...child2)`
|
||||
: `kpiUserEvaluation.child2DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child2: _data.child2,
|
||||
|
|
@ -267,8 +273,8 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.andWhere(
|
||||
_data.child3 != undefined && _data.child3 != null
|
||||
? _data.child3[0] != null
|
||||
? `kpiUserEvaluation.child3Id IN (:...child3)`
|
||||
: `kpiUserEvaluation.child3Id is null`
|
||||
? `kpiUserEvaluation.child3DnaId IN (:...child3)`
|
||||
: `kpiUserEvaluation.child3DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child3: _data.child3,
|
||||
|
|
@ -277,8 +283,8 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.andWhere(
|
||||
_data.child4 != undefined && _data.child4 != null
|
||||
? _data.child4[0] != null
|
||||
? `kpiUserEvaluation.child4Id IN (:...child4)`
|
||||
: `kpiUserEvaluation.child4Id is null`
|
||||
? `kpiUserEvaluation.child4DnaId IN (:...child4)`
|
||||
: `kpiUserEvaluation.child4DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child4: _data.child4,
|
||||
|
|
@ -397,7 +403,13 @@ export class KpiUserEvaluationController extends Controller {
|
|||
results?: string | null;
|
||||
},
|
||||
) {
|
||||
await new permission().PermissionList(request, "SYS_KPI_LIST");
|
||||
let _data = await new permission().PermissionOrgList(request, "SYS_KPI_LIST");
|
||||
await new CallAPI()
|
||||
.PostData(request, "/org/finddna", _data)
|
||||
.then((x) => {
|
||||
_data = x;
|
||||
})
|
||||
.catch((x) => {});
|
||||
let conditionFullName =
|
||||
"CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword";
|
||||
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
|
||||
|
|
@ -459,6 +471,56 @@ export class KpiUserEvaluationController extends Controller {
|
|||
});
|
||||
}),
|
||||
)
|
||||
.andWhere(
|
||||
_data.root != undefined && _data.root != null
|
||||
? _data.root[0] != null
|
||||
? `kpiUserEvaluation.orgDnaId IN (:...root)`
|
||||
: `kpiUserEvaluation.orgDnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
root: _data.root,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child1 != undefined && _data.child1 != null
|
||||
? _data.child1[0] != null
|
||||
? `kpiUserEvaluation.child1DnaId IN (:...child1)`
|
||||
: `kpiUserEvaluation.child1DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child1: _data.child1,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child2 != undefined && _data.child2 != null
|
||||
? _data.child2[0] != null
|
||||
? `kpiUserEvaluation.child2DnaId IN (:...child2)`
|
||||
: `kpiUserEvaluation.child2DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child2: _data.child2,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child3 != undefined && _data.child3 != null
|
||||
? _data.child3[0] != null
|
||||
? `kpiUserEvaluation.child3DnaId IN (:...child3)`
|
||||
: `kpiUserEvaluation.child3DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child3: _data.child3,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
_data.child4 != undefined && _data.child4 != null
|
||||
? _data.child4[0] != null
|
||||
? `kpiUserEvaluation.child4DnaId IN (:...child4)`
|
||||
: `kpiUserEvaluation.child4DnaId is null`
|
||||
: "1=1",
|
||||
{
|
||||
child4: _data.child4,
|
||||
},
|
||||
)
|
||||
.orderBy("kpiPeriod.year", "DESC")
|
||||
.addOrderBy("kpiUserEvaluation.createdAt", "DESC")
|
||||
.skip((requestBody.page - 1) * requestBody.pageSize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue