checkpoint

This commit is contained in:
AdisakKanthawilang 2025-01-06 12:04:54 +07:00
parent 066b6f09b7
commit 0d190479e2
2 changed files with 21 additions and 0 deletions

View file

@ -59,6 +59,15 @@ export class ReoportController {
*/
@Get()
async sumaryEvaluationReport(@Query("year") year?: string, @Query("rootid") rootId?: string) {
const yearInAD = year?year:null;
const evaluation = await AppDataSource.getRepository(Evaluation)
.createQueryBuilder("evaluation")
.where( yearInAD && yearInAD != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInAD })
.andWhere(rootId?'orgRootId = :rootId': "1=1", { rootId: rootId })
.getMany();
return new HttpSuccess({
template: "summary-evaluation",
reportName: "xlsx-report",

View file

@ -33,6 +33,12 @@ export class Evaluation extends EntityBase {
@Column({ nullable: true, comment: "สังกัด" })
oc: string;
@Column({ nullable: true, comment: "สำนักงานที่สังกัด" })
root: string;
@Column({ nullable: true, length: 255, comment: "ไอดีสำนักงานที่สังกัด" })
orgRootId: string;
@Column({
nullable: true,
comment: "root",
@ -294,6 +300,12 @@ export class CreateEvaluation {
@Column()
assessments?: CreateAssessment[];
@Column()
root?: string | null;
@Column()
orgRootId?: string | null;
}
export class CreateEducation {