no message
This commit is contained in:
parent
61ceaea799
commit
90a709e5fd
2 changed files with 32 additions and 1 deletions
|
|
@ -183,6 +183,9 @@ export class ReportController extends Controller {
|
||||||
@Query() endDateAppoint?: Date,
|
@Query() endDateAppoint?: Date,
|
||||||
@Query() ageMin?: number,
|
@Query() ageMin?: number,
|
||||||
@Query() ageMax?: number,
|
@Query() ageMax?: number,
|
||||||
|
@Query() isProbation?: boolean,
|
||||||
|
@Query() isRetire?: boolean,
|
||||||
|
@Query() retireType?: string,
|
||||||
@Query() sortBy: string = "posMasterNo",
|
@Query() sortBy: string = "posMasterNo",
|
||||||
@Query() sort: "ASC"|"DESC" = "ASC",
|
@Query() sort: "ASC"|"DESC" = "ASC",
|
||||||
) {
|
) {
|
||||||
|
|
@ -222,6 +225,15 @@ export class ReportController extends Controller {
|
||||||
} else if (endDateAppoint) {
|
} else if (endDateAppoint) {
|
||||||
dateAppointCondition = "DATE(registryOfficer.dateAppoint) <= :endDateAppoint";
|
dateAppointCondition = "DATE(registryOfficer.dateAppoint) <= :endDateAppoint";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IsLeavecondition = ["registryOfficer.isLeave = :isLeave"];
|
||||||
|
const parameters: any = { isLeave: isRetire };
|
||||||
|
|
||||||
|
if (retireType && retireType.trim() !== "") {
|
||||||
|
IsLeavecondition.push("registryOfficer.leaveType = :retireType");
|
||||||
|
parameters.retireType = retireType;
|
||||||
|
}
|
||||||
|
|
||||||
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
|
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
|
||||||
.createQueryBuilder("registryOfficer")
|
.createQueryBuilder("registryOfficer")
|
||||||
.where(nodeCondition, {
|
.where(nodeCondition, {
|
||||||
|
|
@ -234,6 +246,10 @@ export class ReportController extends Controller {
|
||||||
startDateAppoint: startDateAppoint?.toISOString().split("T")[0],
|
startDateAppoint: startDateAppoint?.toISOString().split("T")[0],
|
||||||
endDateAppoint: endDateAppoint?.toISOString().split("T")[0]
|
endDateAppoint: endDateAppoint?.toISOString().split("T")[0]
|
||||||
})
|
})
|
||||||
|
.andWhere("registryOfficer.isProbation = :isProbation", {
|
||||||
|
isProbation: isProbation,
|
||||||
|
})
|
||||||
|
.andWhere(IsLeavecondition.join(" AND "), parameters)
|
||||||
.andWhere(
|
.andWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.orWhere(
|
qb.orWhere(
|
||||||
|
|
@ -439,6 +455,9 @@ export class ReportController extends Controller {
|
||||||
@Query() degree?: string,
|
@Query() degree?: string,
|
||||||
@Query() startDateAppoint?: Date,
|
@Query() startDateAppoint?: Date,
|
||||||
@Query() endDateAppoint?: Date,
|
@Query() endDateAppoint?: Date,
|
||||||
|
@Query() isProbation?: boolean,
|
||||||
|
@Query() isRetire?: boolean,
|
||||||
|
@Query() retireType?: string,
|
||||||
@Query() ageMin?: number,
|
@Query() ageMin?: number,
|
||||||
@Query() ageMax?: number,
|
@Query() ageMax?: number,
|
||||||
@Query() sortBy: string = "posMasterNo",
|
@Query() sortBy: string = "posMasterNo",
|
||||||
|
|
@ -480,6 +499,14 @@ export class ReportController extends Controller {
|
||||||
} else if (endDateAppoint) {
|
} else if (endDateAppoint) {
|
||||||
dateAppointCondition = "DATE(registryOfficer.dateAppoint) <= :endDateAppoint";
|
dateAppointCondition = "DATE(registryOfficer.dateAppoint) <= :endDateAppoint";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IsLeavecondition = ["registryOfficer.isLeave = :isLeave"];
|
||||||
|
const parameters: any = { isLeave: isRetire };
|
||||||
|
|
||||||
|
if (retireType && retireType.trim() !== "") {
|
||||||
|
IsLeavecondition.push("registryOfficer.leaveType = :retireType");
|
||||||
|
parameters.retireType = retireType;
|
||||||
|
}
|
||||||
const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee)
|
const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee)
|
||||||
.createQueryBuilder("registryOfficer")
|
.createQueryBuilder("registryOfficer")
|
||||||
.where(nodeCondition, {
|
.where(nodeCondition, {
|
||||||
|
|
@ -492,6 +519,10 @@ export class ReportController extends Controller {
|
||||||
startDateAppoint: startDateAppoint?.toISOString().split("T")[0],
|
startDateAppoint: startDateAppoint?.toISOString().split("T")[0],
|
||||||
endDateAppoint: endDateAppoint?.toISOString().split("T")[0]
|
endDateAppoint: endDateAppoint?.toISOString().split("T")[0]
|
||||||
})
|
})
|
||||||
|
.andWhere("registryOfficer.isProbation = :isProbation", {
|
||||||
|
isProbation: isProbation,
|
||||||
|
})
|
||||||
|
.andWhere(IsLeavecondition.join(" AND "), parameters)
|
||||||
.andWhere(
|
.andWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.orWhere(
|
qb.orWhere(
|
||||||
|
|
|
||||||
|
|
@ -1169,7 +1169,7 @@ export class WorkflowController extends Controller {
|
||||||
orgChild2Id: x.orgChild2Id,
|
orgChild2Id: x.orgChild2Id,
|
||||||
orgChild3Id: x.orgChild3Id,
|
orgChild3Id: x.orgChild3Id,
|
||||||
orgChild4Id: x.orgChild4Id,
|
orgChild4Id: x.orgChild4Id,
|
||||||
director: true,
|
isDirector: true,
|
||||||
current_holder: Not(IsNull()),
|
current_holder: Not(IsNull()),
|
||||||
}));
|
}));
|
||||||
const posMaster = await this.posMasterRepo.find({
|
const posMaster = await this.posMasterRepo.find({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue