update
This commit is contained in:
parent
6e374d7992
commit
a455c14ce6
3 changed files with 182 additions and 3 deletions
26
src/entities/view/viewDevScholarship.ts
Normal file
26
src/entities/view/viewDevScholarship.ts
Normal 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;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue