This commit is contained in:
AdisakKanthawilang 2025-08-01 10:12:23 +07:00
parent f382e3622f
commit 18b457c466

View file

@ -99,6 +99,7 @@ export class KpiUserEvaluationController extends Controller {
// } // }
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation) const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
.createQueryBuilder("kpiUserEvaluation") .createQueryBuilder("kpiUserEvaluation")
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
.andWhere( .andWhere(
requestBody.kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1", requestBody.kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1",
{ {
@ -106,7 +107,7 @@ export class KpiUserEvaluationController extends Controller {
}, },
) )
.andWhere( .andWhere(
requestBody.year ? "kpiUserEvaluation.year LIKE :year" : "1=1", {year: requestBody.year}, requestBody.year ? "kpiPeriod.year LIKE :year" : "1=1", {year: requestBody.year},
) )
.andWhere( .andWhere(
requestBody.status != null && requestBody.status != undefined requestBody.status != null && requestBody.status != undefined