parent
78810b0425
commit
57851a044e
1 changed files with 22 additions and 3 deletions
|
|
@ -341,6 +341,21 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.orWhere("kpiUserEvaluation.posLevelName LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere( "kpiUserEvaluation.org LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere( "CONCAT(kpiUserEvaluation.child1,' ', kpiUserEvaluation.org) LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere( "CONCAT(kpiUserEvaluation.child2,' ', kpiUserEvaluation.child1,' ', kpiUserEvaluation.org) LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere( "CONCAT(kpiUserEvaluation.child3,' ', kpiUserEvaluation.child2,' ', kpiUserEvaluation.child1,' ', kpiUserEvaluation.org) LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere( "CONCAT(kpiUserEvaluation.child4,' ', kpiUserEvaluation.child3,' ', kpiUserEvaluation.child2,' ', kpiUserEvaluation.child1,' ', kpiUserEvaluation.org) LIKE :keyword", {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
})
|
||||
.orWhere(conditionFullName, {
|
||||
keyword: `%${requestBody.keyword}%`,
|
||||
});
|
||||
|
|
@ -398,6 +413,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
page: number;
|
||||
pageSize: number;
|
||||
kpiPeriodId?: string;
|
||||
year?: number;
|
||||
keyword?: string;
|
||||
status?: string | null;
|
||||
results?: string | null;
|
||||
|
|
@ -416,11 +432,12 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.createQueryBuilder("kpiUserEvaluation")
|
||||
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
|
||||
.andWhere(
|
||||
requestBody.kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1",
|
||||
requestBody.kpiPeriodId && requestBody.kpiPeriodId != "ALL" ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1",
|
||||
{
|
||||
kpiPeriodId: requestBody.kpiPeriodId,
|
||||
},
|
||||
)
|
||||
.andWhere(requestBody.year ? "kpiPeriod.year = :year": "1=1", { year: requestBody.year })
|
||||
.andWhere(
|
||||
requestBody.status != null && requestBody.status != undefined
|
||||
? "kpiUserEvaluation.evaluationstatus LIKE :status"
|
||||
|
|
@ -1365,6 +1382,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("kpiPeriodId") kpiPeriodId?: string,
|
||||
@Query("year") year?: number,
|
||||
@Query("keyword") keyword?: string,
|
||||
@Query("status") status?: string,
|
||||
@Query("results") results?: string,
|
||||
|
|
@ -1378,13 +1396,14 @@ export class KpiUserEvaluationController extends Controller {
|
|||
.catch(() => {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
|
||||
});
|
||||
|
||||
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
|
||||
.createQueryBuilder("kpiUserEvaluation")
|
||||
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
|
||||
.andWhere(kpiPeriodId ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1", {
|
||||
.andWhere(kpiPeriodId && kpiPeriodId != "ALL" ? "kpiUserEvaluation.kpiPeriodId LIKE :kpiPeriodId" : "1=1", {
|
||||
kpiPeriodId: kpiPeriodId,
|
||||
})
|
||||
// .andWhere({ createdUserId: request.user.sub })
|
||||
.andWhere(year ? "kpiPeriod.year = :year": "1=1", { year: year })
|
||||
.andWhere({ profileId: profileId })
|
||||
.andWhere(
|
||||
status == null || status == undefined
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue