Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 58s
This commit is contained in:
commit
8010a1ab85
3 changed files with 204 additions and 165 deletions
|
|
@ -1021,12 +1021,12 @@ export class EmployeePositionController extends Controller {
|
||||||
let typeCondition: any = {};
|
let typeCondition: any = {};
|
||||||
let checkChildConditions: any = {};
|
let checkChildConditions: any = {};
|
||||||
let keywordAsInt: any;
|
let keywordAsInt: any;
|
||||||
let searchShortName = "";
|
let searchShortName = "1=1";
|
||||||
let searchShortName0 = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName0 = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName3 = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName3 = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName4 = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName4 = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNo)`;
|
||||||
let _data = await new permission().PermissionOrgList(request, "SYS_ORG_EMP");
|
let _data = await new permission().PermissionOrgList(request, "SYS_ORG_EMP");
|
||||||
if (body.type === 0) {
|
if (body.type === 0) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
|
|
@ -1036,7 +1036,7 @@ export class EmployeePositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 1) {
|
} else if (body.type === 1) {
|
||||||
|
|
@ -1047,7 +1047,7 @@ export class EmployeePositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild2Id: IsNull(),
|
orgChild2Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 2) {
|
} else if (body.type === 2) {
|
||||||
|
|
@ -1058,7 +1058,7 @@ export class EmployeePositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild3Id: IsNull(),
|
orgChild3Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 3) {
|
} else if (body.type === 3) {
|
||||||
|
|
@ -1069,14 +1069,14 @@ export class EmployeePositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild4Id: IsNull(),
|
orgChild4Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 4) {
|
} else if (body.type === 4) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
orgChild4Id: body.id,
|
orgChild4Id: body.id,
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
}
|
}
|
||||||
let findPosition: any;
|
let findPosition: any;
|
||||||
let masterId = new Array();
|
let masterId = new Array();
|
||||||
|
|
@ -1126,7 +1126,7 @@ export class EmployeePositionController extends Controller {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const [posMaster, total] = await AppDataSource.getRepository(EmployeePosMaster)
|
let query = AppDataSource.getRepository(EmployeePosMaster)
|
||||||
.createQueryBuilder("posMaster")
|
.createQueryBuilder("posMaster")
|
||||||
.leftJoinAndSelect("posMaster.orgRoot", "orgRoot")
|
.leftJoinAndSelect("posMaster.orgRoot", "orgRoot")
|
||||||
.leftJoinAndSelect("posMaster.orgChild1", "orgChild1")
|
.leftJoinAndSelect("posMaster.orgChild1", "orgChild1")
|
||||||
|
|
@ -1190,7 +1190,9 @@ export class EmployeePositionController extends Controller {
|
||||||
child4: _data.child4,
|
child4: _data.child4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
|
||||||
|
if (body.keyword != null && body.keyword != "") {
|
||||||
|
query.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
|
|
@ -1204,51 +1206,54 @@ export class EmployeePositionController extends Controller {
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CONCAT(current_holder.prefix, current_holder.firstName," ",current_holder.lastName) like '%${body.keyword}%'`
|
? `CONCAT(current_holder.prefix, current_holder.firstName," ",current_holder.lastName) like '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CASE WHEN orgRevision.orgRevisionIsDraft = true THEN CONCAT(next_holder.prefix, next_holder.firstName,' ', next_holder.lastName) ELSE CONCAT(current_holder.prefix, current_holder.firstName,' ' , current_holder.lastName) END LIKE '%${body.keyword}%'`
|
? `CASE WHEN orgRevision.orgRevisionIsDraft = true THEN CONCAT(next_holder.prefix, next_holder.firstName,' ', next_holder.lastName) ELSE CONCAT(current_holder.prefix, current_holder.firstName,' ' , current_holder.lastName) END LIKE '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) like '%${body.keyword}%'`
|
? `CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) like '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
let [posMaster, total] = await query
|
||||||
.orderBy("orgRoot.orgRootOrder", "ASC")
|
.orderBy("orgRoot.orgRootOrder", "ASC")
|
||||||
.addOrderBy("orgChild1.orgChild1Order", "ASC")
|
.addOrderBy("orgChild1.orgChild1Order", "ASC")
|
||||||
.addOrderBy("orgChild2.orgChild2Order", "ASC")
|
.addOrderBy("orgChild2.orgChild2Order", "ASC")
|
||||||
|
|
@ -1661,50 +1666,50 @@ export class EmployeePositionController extends Controller {
|
||||||
const type0LastPosMasterNo =
|
const type0LastPosMasterNo =
|
||||||
requestBody.type == 0
|
requestBody.type == 0
|
||||||
? await this.employeePosMasterRepository.find({
|
? await this.employeePosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgRootId: requestBody.id,
|
orgRootId: requestBody.id,
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type1LastPosMasterNo =
|
const type1LastPosMasterNo =
|
||||||
requestBody.type == 1
|
requestBody.type == 1
|
||||||
? await this.employeePosMasterRepository.find({
|
? await this.employeePosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild1Id: requestBody.id,
|
orgChild1Id: requestBody.id,
|
||||||
orgChild2Id: IsNull(),
|
orgChild2Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type2LastPosMasterNo =
|
const type2LastPosMasterNo =
|
||||||
requestBody.type == 2
|
requestBody.type == 2
|
||||||
? await this.employeePosMasterRepository.find({
|
? await this.employeePosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild2Id: requestBody.id,
|
orgChild2Id: requestBody.id,
|
||||||
orgChild3Id: IsNull(),
|
orgChild3Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type3LastPosMasterNo =
|
const type3LastPosMasterNo =
|
||||||
requestBody.type == 3
|
requestBody.type == 3
|
||||||
? await this.employeePosMasterRepository.find({
|
? await this.employeePosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild3Id: requestBody.id,
|
orgChild3Id: requestBody.id,
|
||||||
orgChild4Id: IsNull(),
|
orgChild4Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type4LastPosMasterNo =
|
const type4LastPosMasterNo =
|
||||||
requestBody.type == 4
|
requestBody.type == 4
|
||||||
? await this.employeePosMasterRepository.find({
|
? await this.employeePosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild4Id: requestBody.id,
|
orgChild4Id: requestBody.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const allLastPosMasterNo = [
|
const allLastPosMasterNo = [
|
||||||
|
|
|
||||||
|
|
@ -769,12 +769,12 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
let typeCondition: any = {};
|
let typeCondition: any = {};
|
||||||
let checkChildConditions: any = {};
|
let checkChildConditions: any = {};
|
||||||
let keywordAsInt: any;
|
let keywordAsInt: any;
|
||||||
let searchShortName = "";
|
let searchShortName = "1=1";
|
||||||
let searchShortName0 = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName0 = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName3 = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName3 = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNo)`;
|
||||||
let searchShortName4 = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
|
let searchShortName4 = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNo)`;
|
||||||
let _data = await new permission().PermissionOrgList(request, "SYS_ORG_TEMP");
|
let _data = await new permission().PermissionOrgList(request, "SYS_ORG_TEMP");
|
||||||
if (body.type === 0) {
|
if (body.type === 0) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
|
|
@ -784,7 +784,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgRoot.orgRootShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 1) {
|
} else if (body.type === 1) {
|
||||||
|
|
@ -795,7 +795,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild2Id: IsNull(),
|
orgChild2Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild1.orgChild1ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 2) {
|
} else if (body.type === 2) {
|
||||||
|
|
@ -806,7 +806,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild3Id: IsNull(),
|
orgChild3Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild2.orgChild2ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 3) {
|
} else if (body.type === 3) {
|
||||||
|
|
@ -817,14 +817,14 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
checkChildConditions = {
|
checkChildConditions = {
|
||||||
orgChild4Id: IsNull(),
|
orgChild4Id: IsNull(),
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild3.orgChild3ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
} else if (body.type === 4) {
|
} else if (body.type === 4) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
orgChild4Id: body.id,
|
orgChild4Id: body.id,
|
||||||
};
|
};
|
||||||
searchShortName = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix) like '%${body.keyword}%'`;
|
searchShortName = `CONCAT(orgChild4.orgChild4ShortName," ",posMaster.posMasterNo) like '%${body.keyword}%'`;
|
||||||
}
|
}
|
||||||
let findPosition: any;
|
let findPosition: any;
|
||||||
let masterId = new Array();
|
let masterId = new Array();
|
||||||
|
|
@ -873,8 +873,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
: { posMasterNo: Like(`%${body.keyword}%`) })),
|
: { posMasterNo: Like(`%${body.keyword}%`) })),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
let query = AppDataSource.getRepository(EmployeeTempPosMaster)
|
||||||
const [posMaster, total] = await AppDataSource.getRepository(EmployeeTempPosMaster)
|
|
||||||
.createQueryBuilder("posMaster")
|
.createQueryBuilder("posMaster")
|
||||||
.leftJoinAndSelect("posMaster.orgRoot", "orgRoot")
|
.leftJoinAndSelect("posMaster.orgRoot", "orgRoot")
|
||||||
.leftJoinAndSelect("posMaster.orgChild1", "orgChild1")
|
.leftJoinAndSelect("posMaster.orgChild1", "orgChild1")
|
||||||
|
|
@ -938,7 +937,9 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
child4: _data.child4,
|
child4: _data.child4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
|
||||||
|
if (body.keyword != null && body.keyword != "") {
|
||||||
|
query.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
|
|
@ -952,51 +953,54 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CONCAT(current_holder.prefix, current_holder.firstName," ",current_holder.lastName) like '%${body.keyword}%'`
|
? `CONCAT(current_holder.prefix, current_holder.firstName," ",current_holder.lastName) like '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CASE WHEN orgRevision.orgRevisionIsDraft = true THEN CONCAT(next_holder.prefix, next_holder.firstName,' ', next_holder.lastName) ELSE CONCAT(current_holder.prefix, current_holder.firstName,' ' , current_holder.lastName) END LIKE '%${body.keyword}%'`
|
? `CASE WHEN orgRevision.orgRevisionIsDraft = true THEN CONCAT(next_holder.prefix, next_holder.firstName,' ', next_holder.lastName) ELSE CONCAT(current_holder.prefix, current_holder.firstName,' ' , current_holder.lastName) END LIKE '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(
|
qb.andWhere(
|
||||||
body.keyword != null && body.keyword != ""
|
body.keyword != null && body.keyword != ""
|
||||||
? `CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) like '%${body.keyword}%'`
|
? `CONCAT(posType.posTypeShortName,' ',posLevel.posLevelName) like '%${body.keyword}%'`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${body.keyword}%`,
|
keyword: `%${body.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.andWhere(checkChildConditions)
|
.andWhere(checkChildConditions)
|
||||||
.andWhere(typeCondition)
|
.andWhere(typeCondition)
|
||||||
.andWhere(revisionCondition);
|
.andWhere(revisionCondition);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
let [posMaster, total] = await query
|
||||||
.orderBy("orgRoot.orgRootOrder", "ASC")
|
.orderBy("orgRoot.orgRootOrder", "ASC")
|
||||||
.addOrderBy("orgChild1.orgChild1Order", "ASC")
|
.addOrderBy("orgChild1.orgChild1Order", "ASC")
|
||||||
.addOrderBy("orgChild2.orgChild2Order", "ASC")
|
.addOrderBy("orgChild2.orgChild2Order", "ASC")
|
||||||
|
|
@ -1408,50 +1412,50 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
const type0LastPosMasterNo =
|
const type0LastPosMasterNo =
|
||||||
requestBody.type == 0
|
requestBody.type == 0
|
||||||
? await this.employeeTempPosMasterRepository.find({
|
? await this.employeeTempPosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgRootId: requestBody.id,
|
orgRootId: requestBody.id,
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type1LastPosMasterNo =
|
const type1LastPosMasterNo =
|
||||||
requestBody.type == 1
|
requestBody.type == 1
|
||||||
? await this.employeeTempPosMasterRepository.find({
|
? await this.employeeTempPosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild1Id: requestBody.id,
|
orgChild1Id: requestBody.id,
|
||||||
orgChild2Id: IsNull(),
|
orgChild2Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type2LastPosMasterNo =
|
const type2LastPosMasterNo =
|
||||||
requestBody.type == 2
|
requestBody.type == 2
|
||||||
? await this.employeeTempPosMasterRepository.find({
|
? await this.employeeTempPosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild2Id: requestBody.id,
|
orgChild2Id: requestBody.id,
|
||||||
orgChild3Id: IsNull(),
|
orgChild3Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type3LastPosMasterNo =
|
const type3LastPosMasterNo =
|
||||||
requestBody.type == 3
|
requestBody.type == 3
|
||||||
? await this.employeeTempPosMasterRepository.find({
|
? await this.employeeTempPosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild3Id: requestBody.id,
|
orgChild3Id: requestBody.id,
|
||||||
orgChild4Id: IsNull(),
|
orgChild4Id: IsNull(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const type4LastPosMasterNo =
|
const type4LastPosMasterNo =
|
||||||
requestBody.type == 4
|
requestBody.type == 4
|
||||||
? await this.employeeTempPosMasterRepository.find({
|
? await this.employeeTempPosMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgChild4Id: requestBody.id,
|
orgChild4Id: requestBody.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const allLastPosMasterNo = [
|
const allLastPosMasterNo = [
|
||||||
|
|
|
||||||
|
|
@ -2389,6 +2389,36 @@ export class PositionController extends Controller {
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{ child1: _data.child1 }
|
{ child1: _data.child1 }
|
||||||
)
|
)
|
||||||
|
.andWhere(
|
||||||
|
_data.child2 != undefined && _data.child2 != null
|
||||||
|
? _data.child2[0] != null
|
||||||
|
? `posMaster.orgChild2Id IN (:...child2)`
|
||||||
|
: `posMaster.orgChild2Id is null`
|
||||||
|
: "1=1",
|
||||||
|
{
|
||||||
|
child2: _data.child2,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.andWhere(
|
||||||
|
_data.child3 != undefined && _data.child3 != null
|
||||||
|
? _data.child3[0] != null
|
||||||
|
? `posMaster.orgChild3Id IN (:...child3)`
|
||||||
|
: `posMaster.orgChild3Id is null`
|
||||||
|
: "1=1",
|
||||||
|
{
|
||||||
|
child3: _data.child3,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.andWhere(
|
||||||
|
_data.child4 != undefined && _data.child4 != null
|
||||||
|
? _data.child4[0] != null
|
||||||
|
? `posMaster.orgChild4Id IN (:...child4)`
|
||||||
|
: `posMaster.orgChild4Id is null`
|
||||||
|
: "1=1",
|
||||||
|
{
|
||||||
|
child4: _data.child4,
|
||||||
|
},
|
||||||
|
)
|
||||||
// .andWhere(checkChildConditions)
|
// .andWhere(checkChildConditions)
|
||||||
// .andWhere(typeCondition)
|
// .andWhere(typeCondition)
|
||||||
// .andWhere(revisionCondition);
|
// .andWhere(revisionCondition);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue