diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 537e8cd..06dbc9e 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -440,7 +440,8 @@ export class SalaryPeriodController extends Controller { @Put("org/{id}") async GetListsSalaryProfile( @Path() id: string, - @Body() body: { page: number; pageSize: number; keyword?: string; type: string }, + @Body() + body: { page: number; pageSize: number; keyword?: string; type?: any; isRetire?: boolean }, ) { const salaryOrg = await this.salaryOrgRepository.findOne({ where: { @@ -452,11 +453,14 @@ export class SalaryPeriodController extends Controller { } const [salaryProfile, total] = await AppDataSource.getRepository(SalaryProfile) .createQueryBuilder("profile") - .orWhere( + .andWhere( new Brackets((qb) => { qb.andWhere(body.type != null && body.type != "" ? "profile.type LIKE :type" : "1=1", { type: `%${body.type.toUpperCase()}%`, }) + .andWhere(body.isRetire != null ? "profile.isRetire = :isRetire" : "1=1", { + isRetire: `${body.isRetire}`, + }) .andWhere({ salaryOrgId: salaryOrg.id, })