fix year
This commit is contained in:
parent
b3529b4b9c
commit
6f5eb2455a
1 changed files with 2 additions and 1 deletions
|
|
@ -61,11 +61,12 @@ export class ReoportController {
|
|||
async sumaryEvaluationReport(@Query("year") year?: string, @Query("rootid") rootId?: string) {
|
||||
|
||||
const yearInAD = year?year:null;
|
||||
const yearInBE = yearInAD ? (parseInt(yearInAD) - 543).toString() : null;
|
||||
|
||||
const evaluation = await AppDataSource.getRepository(Evaluation)
|
||||
.createQueryBuilder("evaluation")
|
||||
.where('evaluation.evaluationResult NOT IN (:...evaluationResults)', { evaluationResults: ['PENDING'] })
|
||||
.andWhere( yearInAD && yearInAD != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInAD })
|
||||
.andWhere( yearInBE && yearInBE != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInBE })
|
||||
.andWhere(rootId?'orgRootId = :rootId': "1=1", { rootId: rootId })
|
||||
.andWhere('evaluation.step = :step', { step: 'DONE' })
|
||||
.getMany();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue