checkpoint
This commit is contained in:
parent
066b6f09b7
commit
0d190479e2
2 changed files with 21 additions and 0 deletions
|
|
@ -59,6 +59,15 @@ export class ReoportController {
|
||||||
*/
|
*/
|
||||||
@Get()
|
@Get()
|
||||||
async sumaryEvaluationReport(@Query("year") year?: string, @Query("rootid") rootId?: string) {
|
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({
|
return new HttpSuccess({
|
||||||
template: "summary-evaluation",
|
template: "summary-evaluation",
|
||||||
reportName: "xlsx-report",
|
reportName: "xlsx-report",
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,12 @@ export class Evaluation extends EntityBase {
|
||||||
@Column({ nullable: true, comment: "สังกัด" })
|
@Column({ nullable: true, comment: "สังกัด" })
|
||||||
oc: string;
|
oc: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true, comment: "สำนักงานที่สังกัด" })
|
||||||
|
root: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 255, comment: "ไอดีสำนักงานที่สังกัด" })
|
||||||
|
orgRootId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "root",
|
comment: "root",
|
||||||
|
|
@ -294,6 +300,12 @@ export class CreateEvaluation {
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
assessments?: CreateAssessment[];
|
assessments?: CreateAssessment[];
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
root?: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
orgRootId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateEducation {
|
export class CreateEducation {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue