Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop
This commit is contained in:
commit
3eee6bd69f
2 changed files with 78 additions and 2 deletions
25
src/entities/view/viewProfileEvaluation.ts
Normal file
25
src/entities/view/viewProfileEvaluation.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { ViewColumn, ViewEntity } from "typeorm";
|
||||
|
||||
@ViewEntity({
|
||||
expression: `SELECT
|
||||
\`profileId\`, \`period\`, \`year\`, COUNT(*) AS recordCount, SUM(pointSum) AS totalPointSum, SUM(pointSum) / COUNT(*) AS result
|
||||
FROM \`profileAssessment\`
|
||||
WHERE \`period\` Is not null
|
||||
GROUP BY \`profileId\`, \`period\`, \`year\`
|
||||
ORDER BY \`year\` desc , \`period\` asc
|
||||
`,
|
||||
})
|
||||
export class viewDirectorActing {
|
||||
@ViewColumn()
|
||||
profileId: string;
|
||||
@ViewColumn()
|
||||
period: string;
|
||||
@ViewColumn()
|
||||
year: number;
|
||||
@ViewColumn()
|
||||
recordCount: number;
|
||||
@ViewColumn()
|
||||
totalPointSum: number;
|
||||
@ViewColumn()
|
||||
result: number;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue