This commit is contained in:
AdisakKanthawilang 2025-02-13 17:34:19 +07:00
parent 6e374d7992
commit a455c14ce6
3 changed files with 182 additions and 3 deletions

View file

@ -0,0 +1,26 @@
import { ViewColumn, ViewEntity } from "typeorm";
@ViewEntity({
expression: `SELECT MAX(\`rootId\`) AS rootId,
MAX(\`root\`) AS root,\`degreeLevel\`,
COUNT(*) AS numberOfRecords,
COUNT(DISTINCT \`scholarshipType\`) AS numberOfScholarshipTypes,
SUM(\`budgetApprove\`) AS totalBudgetApprove
FROM \`developmentScholarship\`
GROUP BY \`rootId\`,\`degreeLevel\`
`,
})
export class viewProfileEvaluation {
@ViewColumn()
rootId: string;
@ViewColumn()
root: string;
@ViewColumn()
numberOfRecords: number;
@ViewColumn()
numberOfScholarshipTypes: number;
@ViewColumn()
totalBudgetApprove: number;
}