@dssp/dkpi 1.0.0-alpha.7 → 1.0.0-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/KPI-STATISTICS-SERVICE.md +233 -0
- package/_index.html +0 -5
- package/assets/favicon.ico +0 -0
- package/assets/images/project-image.png +0 -0
- package/assets/manifest/apple-1024.png +0 -0
- package/assets/manifest/apple-120.png +0 -0
- package/assets/manifest/apple-152.png +0 -0
- package/assets/manifest/apple-167.png +0 -0
- package/assets/manifest/apple-180.png +0 -0
- package/assets/manifest/apple-touch-icon.png +0 -0
- package/assets/manifest/badge-128x128.png +0 -0
- package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
- package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
- package/assets/manifest/icon-128x128.png +0 -0
- package/assets/manifest/icon-192x192.png +0 -0
- package/assets/manifest/icon-512x512.png +0 -0
- package/assets/manifest/icon-72x72.png +0 -0
- package/assets/manifest/icon-96x96.png +0 -0
- package/assets/manifest/image-metaog.png +0 -0
- package/assets/manifest/maskable_icon.png +0 -0
- package/assets/manifest/ms-icon-144x144.png +0 -0
- package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
- package/assets/videos/intro.mp4 +0 -0
- package/dist-client/bootstrap.js +64 -4
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +43 -0
- package/dist-client/components/kpi-2d-lookup-chart.js +253 -0
- package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-boxplot-chart.d.ts +24 -0
- package/dist-client/components/kpi-boxplot-chart.js +291 -0
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-lookup-chart.d.ts +53 -0
- package/dist-client/components/kpi-lookup-chart.js +430 -0
- package/dist-client/components/kpi-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/components/kpi-mini-trend-chart.js +148 -0
- package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/components/kpi-radar-chart.d.ts +17 -0
- package/dist-client/components/kpi-radar-chart.js +259 -0
- package/dist-client/components/kpi-radar-chart.js.map +1 -0
- package/dist-client/components/kpi-single-boxplot-chart.d.ts +24 -0
- package/dist-client/components/kpi-single-boxplot-chart.js +391 -0
- package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-trend-chart.d.ts +25 -0
- package/dist-client/components/kpi-trend-chart.js +220 -0
- package/dist-client/components/kpi-trend-chart.js.map +1 -0
- package/dist-client/components/sv-pagenation-control.d.ts +18 -0
- package/dist-client/components/sv-pagenation-control.js +142 -0
- package/dist-client/components/sv-pagenation-control.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +35 -0
- package/dist-client/google-map/common-google-map.js +345 -0
- package/dist-client/google-map/common-google-map.js.map +1 -0
- package/dist-client/google-map/google-map-loader.d.ts +6 -0
- package/dist-client/google-map/google-map-loader.js +23 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/icons/menu-icons.d.ts +6 -0
- package/dist-client/icons/menu-icons.js +42 -0
- package/dist-client/icons/menu-icons.js.map +1 -1
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +22 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +57 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.d.ts +46 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +378 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +20 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +445 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +1 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.d.ts +18 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js +535 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +259 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +22 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +346 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +26 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +433 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +38 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +851 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +42 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +316 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +28 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +497 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +52 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +798 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +63 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1089 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +57 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +719 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +76 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +68 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +380 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +12 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +174 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +40 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +190 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +71 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +464 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +14 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +339 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +14 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +276 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +18 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +307 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +18 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +433 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
- package/dist-client/pages/sv-project-complete.d.ts +21 -0
- package/dist-client/pages/sv-project-complete.js +213 -0
- package/dist-client/pages/sv-project-complete.js.map +1 -0
- package/dist-client/pages/sv-project-completed-list.d.ts +27 -0
- package/dist-client/pages/sv-project-completed-list.js +416 -0
- package/dist-client/pages/sv-project-completed-list.js.map +1 -0
- package/dist-client/pages/sv-project-detail.d.ts +46 -0
- package/dist-client/pages/sv-project-detail.js +1236 -0
- package/dist-client/pages/sv-project-detail.js.map +1 -0
- package/dist-client/pages/sv-project-list.d.ts +165 -0
- package/dist-client/pages/sv-project-list.js +488 -0
- package/dist-client/pages/sv-project-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +35 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +8 -0
- package/dist-client/shared/complete-api.js +177 -0
- package/dist-client/shared/complete-api.js.map +1 -0
- package/dist-client/shared/func.d.ts +2 -0
- package/dist-client/shared/func.js +22 -0
- package/dist-client/shared/func.js.map +1 -0
- package/dist-client/themes/dark.css +24 -24
- package/dist-client/themes/light.css +23 -23
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +40 -5
- package/dist-client/viewparts/menu-tools.js +289 -34
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/scripts/calculate-kpi-scores.d.ts +10 -0
- package/dist-server/scripts/calculate-kpi-scores.js +333 -0
- package/dist-server/scripts/calculate-kpi-scores.js.map +1 -0
- package/dist-server/scripts/load-grade-data-migration.d.ts +14 -0
- package/dist-server/scripts/load-grade-data-migration.js +279 -0
- package/dist-server/scripts/load-grade-data-migration.js.map +1 -0
- package/dist-server/scripts/propagate-parent-kpi-values.d.ts +14 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js +786 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -0
- package/dist-server/scripts/recalculate-by-project-name.d.ts +2 -0
- package/dist-server/scripts/recalculate-by-project-name.js +72 -0
- package/dist-server/scripts/recalculate-by-project-name.js.map +1 -0
- package/dist-server/service/index.d.ts +4 -0
- package/dist-server/service/index.js +20 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/kpi-metric-value/index.d.ts +4 -0
- package/dist-server/service/kpi-metric-value/index.js +8 -0
- package/dist-server/service/kpi-metric-value/index.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +74 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +687 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +7 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +52 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -0
- package/dist-server/service/kpi-stat/index.d.ts +4 -0
- package/dist-server/service/kpi-stat/index.js +8 -0
- package/dist-server/service/kpi-stat/index.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +12 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js +662 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +32 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js +180 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -0
- package/dist-server/service/kpi-value/index.d.ts +3 -0
- package/dist-server/service/kpi-value/index.js +7 -0
- package/dist-server/service/kpi-value/index.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +8 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +69 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/kpi-module-service-tests.md +1286 -0
- package/kpi-module-test-report.md +676 -0
- package/kpi-module-unit-test-detailed-report.md +925 -0
- package/kpi-module-unit-tests-detailed.md +1452 -0
- package/package.json +65 -55
- package/recalculate-batch.sh +64 -0
- package/recalculate-projects-range.sh +98 -0
- package/schema.graphql +2514 -455
- package/things-factory.config.js +11 -1
- package/views/auth-page.html +0 -1
- package/views/public/home.html +0 -1
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiStatQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const kpi_1 = require("@things-factory/kpi");
|
|
8
|
+
const kpi_stat_types_1 = require("./kpi-stat-types");
|
|
9
|
+
let KpiStatQuery = class KpiStatQuery {
|
|
10
|
+
async totalKpiZValueComprehensiveStats(startYearMonth, endYearMonth, sectorType, buildingUsage, context) {
|
|
11
|
+
const { domain } = context.state;
|
|
12
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
13
|
+
.createQueryBuilder('kv')
|
|
14
|
+
.select([
|
|
15
|
+
'k.name as kpiName',
|
|
16
|
+
'MIN(kv.score) as minVal',
|
|
17
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
18
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
19
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
20
|
+
'AVG(kv.score) as avgVal',
|
|
21
|
+
'MAX(kv.score) as maxVal',
|
|
22
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
23
|
+
])
|
|
24
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
25
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
26
|
+
.where('k.name LIKE :pattern', { pattern: 'Z%' })
|
|
27
|
+
.andWhere('p.end_date IS NOT NULL')
|
|
28
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
29
|
+
// 기간 필터
|
|
30
|
+
if (startYearMonth && startYearMonth.trim() !== '') {
|
|
31
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
32
|
+
}
|
|
33
|
+
if (endYearMonth && endYearMonth.trim() !== '') {
|
|
34
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
35
|
+
}
|
|
36
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
37
|
+
queryBuilder.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
38
|
+
}
|
|
39
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
40
|
+
queryBuilder.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
41
|
+
}
|
|
42
|
+
queryBuilder.groupBy('k.name');
|
|
43
|
+
const results = await queryBuilder.getRawMany();
|
|
44
|
+
return results.map(result => {
|
|
45
|
+
const kpiName = result.kpiname;
|
|
46
|
+
const minVal = Math.min(Math.max(Number(result.minval), 0), 1);
|
|
47
|
+
const q1Val = Math.min(Math.max(Number(result.q1val), 0), 1);
|
|
48
|
+
const medVal = Math.min(Math.max(Number(result.medval), 0), 1);
|
|
49
|
+
const q3Val = Math.min(Math.max(Number(result.q3val), 0), 1);
|
|
50
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
51
|
+
const maxVal = Math.min(Math.max(Number(result.maxval), 0), 1);
|
|
52
|
+
const projectCount = Number(result.projectcount);
|
|
53
|
+
return {
|
|
54
|
+
kpiName: kpiName,
|
|
55
|
+
minVal: isNaN(minVal) ? 0 : minVal,
|
|
56
|
+
q1Val: isNaN(q1Val) ? 0 : q1Val,
|
|
57
|
+
medVal: isNaN(medVal) ? 0 : medVal,
|
|
58
|
+
q3Val: isNaN(q3Val) ? 0 : q3Val,
|
|
59
|
+
maxVal: isNaN(maxVal) ? 0 : maxVal,
|
|
60
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
61
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async totalKpiYValueComprehensiveStats(startYearMonth, endYearMonth, sectorType, buildingUsage, context) {
|
|
66
|
+
const { domain } = context.state;
|
|
67
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
68
|
+
.createQueryBuilder('kv')
|
|
69
|
+
.select([
|
|
70
|
+
'k.name as kpiName',
|
|
71
|
+
'MIN(kv.score) as minVal',
|
|
72
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
73
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
74
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
75
|
+
'AVG(kv.score) as avgVal',
|
|
76
|
+
'MAX(kv.score) as maxVal',
|
|
77
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
78
|
+
])
|
|
79
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
80
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
81
|
+
.where('k.name LIKE :pattern', { pattern: 'Y%' })
|
|
82
|
+
.andWhere('p.end_date IS NOT NULL')
|
|
83
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
84
|
+
// 기간 필터
|
|
85
|
+
if (startYearMonth && startYearMonth.trim() !== '') {
|
|
86
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
87
|
+
}
|
|
88
|
+
if (endYearMonth && endYearMonth.trim() !== '') {
|
|
89
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
90
|
+
}
|
|
91
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
92
|
+
queryBuilder.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
93
|
+
}
|
|
94
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
95
|
+
queryBuilder.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
96
|
+
}
|
|
97
|
+
queryBuilder.groupBy('k.name').orderBy('k.name', 'ASC');
|
|
98
|
+
const results = await queryBuilder.getRawMany();
|
|
99
|
+
return results.map(result => {
|
|
100
|
+
const kpiName = result.kpiname;
|
|
101
|
+
const minVal = Math.min(Math.max(Number(result.minval), 0), 1);
|
|
102
|
+
const q1Val = Math.min(Math.max(Number(result.q1val), 0), 1);
|
|
103
|
+
const medVal = Math.min(Math.max(Number(result.medval), 0), 1);
|
|
104
|
+
const q3Val = Math.min(Math.max(Number(result.q3val), 0), 1);
|
|
105
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
106
|
+
const maxVal = Math.min(Math.max(Number(result.maxval), 0), 1);
|
|
107
|
+
const projectCount = Number(result.projectcount);
|
|
108
|
+
return {
|
|
109
|
+
kpiName: kpiName,
|
|
110
|
+
minVal: isNaN(minVal) ? 0 : minVal,
|
|
111
|
+
q1Val: isNaN(q1Val) ? 0 : q1Val,
|
|
112
|
+
medVal: isNaN(medVal) ? 0 : medVal,
|
|
113
|
+
q3Val: isNaN(q3Val) ? 0 : q3Val,
|
|
114
|
+
maxVal: isNaN(maxVal) ? 0 : maxVal,
|
|
115
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
116
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async kpiZValueComprehensiveStatsByGeoGroup(geoGroup, kpiName, startYearMonth, endYearMonth, sectorType, buildingUsage, context) {
|
|
121
|
+
const { domain } = context.state;
|
|
122
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
123
|
+
.createQueryBuilder('kv')
|
|
124
|
+
.select([
|
|
125
|
+
`CASE
|
|
126
|
+
WHEN p.geo_group IN ('01','02','03','04','05','06','07','08') THEN '서울특별시'
|
|
127
|
+
WHEN p.geo_group IN ('46','47','48','49') THEN '부산광역시'
|
|
128
|
+
WHEN p.geo_group IN ('41','42','43') THEN '대구광역시'
|
|
129
|
+
WHEN p.geo_group IN ('21','22','23') THEN '인천광역시'
|
|
130
|
+
WHEN p.geo_group IN ('61','62') THEN '광주광역시'
|
|
131
|
+
WHEN p.geo_group IN ('34','35') THEN '대전광역시'
|
|
132
|
+
WHEN p.geo_group IN ('44','45') THEN '울산광역시'
|
|
133
|
+
WHEN p.geo_group = '30' THEN '세종특별자치시'
|
|
134
|
+
WHEN p.geo_group IN ('10','11','12','13','14','15','16','17','18') THEN '경기도'
|
|
135
|
+
WHEN p.geo_group IN ('24','25','26','33') THEN '강원도'
|
|
136
|
+
WHEN p.geo_group IN ('27','28','29') THEN '충청북도'
|
|
137
|
+
WHEN p.geo_group IN ('31','32') THEN '충청남도'
|
|
138
|
+
WHEN p.geo_group IN ('54','55','56') THEN '전라북도'
|
|
139
|
+
WHEN p.geo_group IN ('57','58','59') THEN '전라남도'
|
|
140
|
+
WHEN p.geo_group IN ('36','37','38','39','40') THEN '경상북도'
|
|
141
|
+
WHEN p.geo_group IN ('50','51','52','53') THEN '경상남도'
|
|
142
|
+
WHEN p.geo_group = '63' THEN '제주특별자치도'
|
|
143
|
+
END as geoGroup`,
|
|
144
|
+
'MIN(kv.score) as minVal',
|
|
145
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
146
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
147
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
148
|
+
'MAX(kv.score) as maxVal',
|
|
149
|
+
'AVG(kv.score) as avgVal',
|
|
150
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
151
|
+
])
|
|
152
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
153
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
154
|
+
.where('p.end_date IS NOT NULL')
|
|
155
|
+
.andWhere('p.geo_group IS NOT NULL')
|
|
156
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
157
|
+
// 기간 필터
|
|
158
|
+
if (startYearMonth && startYearMonth.trim() !== '') {
|
|
159
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
160
|
+
}
|
|
161
|
+
if (endYearMonth && endYearMonth.trim() !== '') {
|
|
162
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
163
|
+
}
|
|
164
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
165
|
+
queryBuilder.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
166
|
+
}
|
|
167
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
168
|
+
queryBuilder.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
169
|
+
}
|
|
170
|
+
// KPI 필터: kpiName이 지정되면 해당 Y-level KPI만, 없으면 Z-level KPI 전체
|
|
171
|
+
if (kpiName && kpiName.trim() !== '') {
|
|
172
|
+
queryBuilder.andWhere('k.name = :kpiName', { kpiName });
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
queryBuilder.andWhere('k.name LIKE :pattern', { pattern: 'Z%' });
|
|
176
|
+
}
|
|
177
|
+
queryBuilder.groupBy('geoGroup');
|
|
178
|
+
if (geoGroup && geoGroup.trim() !== '') {
|
|
179
|
+
queryBuilder.having('geoGroup = :geoGroup', { geoGroup });
|
|
180
|
+
}
|
|
181
|
+
const results = await queryBuilder.getRawMany();
|
|
182
|
+
return results
|
|
183
|
+
.map(result => {
|
|
184
|
+
const kpiName = result.kpiname;
|
|
185
|
+
const minVal = Math.min(Math.max(Number(result.minval), 0), 1);
|
|
186
|
+
const q1Val = Math.min(Math.max(Number(result.q1val), 0), 1);
|
|
187
|
+
const medVal = Math.min(Math.max(Number(result.medval), 0), 1);
|
|
188
|
+
const q3Val = Math.min(Math.max(Number(result.q3val), 0), 1);
|
|
189
|
+
const maxVal = Math.min(Math.max(Number(result.maxval), 0), 1);
|
|
190
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
191
|
+
const projectCount = Number(result.projectcount);
|
|
192
|
+
return {
|
|
193
|
+
kpiName: kpiName,
|
|
194
|
+
geoGroup: result.geogroup || null,
|
|
195
|
+
minVal: isNaN(minVal) ? 0 : minVal,
|
|
196
|
+
q1Val: isNaN(q1Val) ? 0 : q1Val,
|
|
197
|
+
medVal: isNaN(medVal) ? 0 : medVal,
|
|
198
|
+
q3Val: isNaN(q3Val) ? 0 : q3Val,
|
|
199
|
+
maxVal: isNaN(maxVal) ? 0 : maxVal,
|
|
200
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
201
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
.filter(result => result.geoGroup !== null);
|
|
205
|
+
}
|
|
206
|
+
async kpiYValueComprehensiveStatsByGeoGroup(geoGroup, context) {
|
|
207
|
+
const { domain } = context.state;
|
|
208
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
209
|
+
.createQueryBuilder('kv')
|
|
210
|
+
.select([
|
|
211
|
+
'p.geo_group as geoGroup',
|
|
212
|
+
'k.name as kpiName',
|
|
213
|
+
'MIN(kv.score) as minVal',
|
|
214
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
215
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
216
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
217
|
+
'MAX(kv.score) as maxVal',
|
|
218
|
+
'AVG(kv.score) as avgVal',
|
|
219
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
220
|
+
])
|
|
221
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
222
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
223
|
+
.where('k.name LIKE :pattern', { pattern: 'Y%' })
|
|
224
|
+
.andWhere('p.end_date IS NOT NULL')
|
|
225
|
+
.andWhere('p.geo_group IS NOT NULL')
|
|
226
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id })
|
|
227
|
+
.groupBy('p.geo_group, k.name');
|
|
228
|
+
if (geoGroup && geoGroup.trim() !== '') {
|
|
229
|
+
queryBuilder.andWhere('p.geo_group LIKE :geoGroup', { geoGroup: `%${geoGroup}%` });
|
|
230
|
+
}
|
|
231
|
+
const results = await queryBuilder.getRawMany();
|
|
232
|
+
return results
|
|
233
|
+
.map(result => {
|
|
234
|
+
const kpiName = result.kpiname;
|
|
235
|
+
const minVal = Math.min(Math.max(Number(result.minval), 0), 1);
|
|
236
|
+
const q1Val = Math.min(Math.max(Number(result.q1val), 0), 1);
|
|
237
|
+
const medVal = Math.min(Math.max(Number(result.medval), 0), 1);
|
|
238
|
+
const q3Val = Math.min(Math.max(Number(result.q3val), 0), 1);
|
|
239
|
+
const maxVal = Math.min(Math.max(Number(result.maxval), 0), 1);
|
|
240
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
241
|
+
const projectCount = Number(result.projectcount);
|
|
242
|
+
return {
|
|
243
|
+
kpiName: kpiName,
|
|
244
|
+
geoGroup: result.geogroup || null,
|
|
245
|
+
minVal: isNaN(minVal) ? 0 : minVal,
|
|
246
|
+
q1Val: isNaN(q1Val) ? 0 : q1Val,
|
|
247
|
+
medVal: isNaN(medVal) ? 0 : medVal,
|
|
248
|
+
q3Val: isNaN(q3Val) ? 0 : q3Val,
|
|
249
|
+
maxVal: isNaN(maxVal) ? 0 : maxVal,
|
|
250
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
251
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
252
|
+
};
|
|
253
|
+
})
|
|
254
|
+
.filter(result => result.geoGroup !== null);
|
|
255
|
+
}
|
|
256
|
+
async kpiZValueMonthlyTrendByGeoGroup(kpiName, startYearMonth, endYearMonth, sectorType, buildingUsage, context) {
|
|
257
|
+
const { domain } = context.state;
|
|
258
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
259
|
+
.createQueryBuilder('kv')
|
|
260
|
+
.select([
|
|
261
|
+
`CASE
|
|
262
|
+
WHEN p.geo_group IN ('01','02','03','04','05','06','07','08') THEN '서울특별시'
|
|
263
|
+
WHEN p.geo_group IN ('46','47','48','49') THEN '부산광역시'
|
|
264
|
+
WHEN p.geo_group IN ('41','42','43') THEN '대구광역시'
|
|
265
|
+
WHEN p.geo_group IN ('21','22','23') THEN '인천광역시'
|
|
266
|
+
WHEN p.geo_group IN ('61','62') THEN '광주광역시'
|
|
267
|
+
WHEN p.geo_group IN ('34','35') THEN '대전광역시'
|
|
268
|
+
WHEN p.geo_group IN ('44','45') THEN '울산광역시'
|
|
269
|
+
WHEN p.geo_group = '30' THEN '세종특별자치시'
|
|
270
|
+
WHEN p.geo_group IN ('10','11','12','13','14','15','16','17','18') THEN '경기도'
|
|
271
|
+
WHEN p.geo_group IN ('24','25','26','33') THEN '강원도'
|
|
272
|
+
WHEN p.geo_group IN ('27','28','29') THEN '충청북도'
|
|
273
|
+
WHEN p.geo_group IN ('31','32') THEN '충청남도'
|
|
274
|
+
WHEN p.geo_group IN ('54','55','56') THEN '전라북도'
|
|
275
|
+
WHEN p.geo_group IN ('57','58','59') THEN '전라남도'
|
|
276
|
+
WHEN p.geo_group IN ('36','37','38','39','40') THEN '경상북도'
|
|
277
|
+
WHEN p.geo_group IN ('50','51','52','53') THEN '경상남도'
|
|
278
|
+
WHEN p.geo_group = '63' THEN '제주특별자치도'
|
|
279
|
+
END as geoGroup`,
|
|
280
|
+
`TO_CHAR(p.end_date, 'YYYY-MM') as yearMonth`,
|
|
281
|
+
'AVG(kv.score) as avgVal',
|
|
282
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
283
|
+
])
|
|
284
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
285
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
286
|
+
.where('p.end_date IS NOT NULL')
|
|
287
|
+
.andWhere('p.geo_group IS NOT NULL')
|
|
288
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
289
|
+
// 기간 필터
|
|
290
|
+
if (startYearMonth && startYearMonth.trim() !== '') {
|
|
291
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
292
|
+
}
|
|
293
|
+
if (endYearMonth && endYearMonth.trim() !== '') {
|
|
294
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
295
|
+
}
|
|
296
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
297
|
+
queryBuilder.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
298
|
+
}
|
|
299
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
300
|
+
queryBuilder.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
301
|
+
}
|
|
302
|
+
// KPI 필터: kpiName이 지정되면 해당 Y-level KPI만, 없으면 Z-level KPI 전체
|
|
303
|
+
if (kpiName && kpiName.trim() !== '') {
|
|
304
|
+
queryBuilder.andWhere('k.name = :kpiName', { kpiName });
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
queryBuilder.andWhere('k.name LIKE :pattern', { pattern: 'Z%' });
|
|
308
|
+
}
|
|
309
|
+
queryBuilder.groupBy('geoGroup, yearMonth').orderBy('yearMonth', 'ASC');
|
|
310
|
+
const results = await queryBuilder.getRawMany();
|
|
311
|
+
return results
|
|
312
|
+
.map(result => {
|
|
313
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
314
|
+
const projectCount = Number(result.projectcount);
|
|
315
|
+
return {
|
|
316
|
+
geoGroup: result.geogroup || null,
|
|
317
|
+
yearMonth: result.yearmonth,
|
|
318
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
319
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
320
|
+
};
|
|
321
|
+
})
|
|
322
|
+
.filter(result => result.geoGroup !== null);
|
|
323
|
+
}
|
|
324
|
+
async kpiProjectStats(sectorType, buildingUsage, kpiNamePattern, startYearMonth, endYearMonth, context) {
|
|
325
|
+
const { domain } = context.state;
|
|
326
|
+
const qb = (0, shell_1.getRepository)('kpi_values')
|
|
327
|
+
.createQueryBuilder('kv')
|
|
328
|
+
.select([
|
|
329
|
+
'k.name as kpiName',
|
|
330
|
+
'pk.name as categoryName',
|
|
331
|
+
'MIN(kv.score) as minVal',
|
|
332
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
333
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
334
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
335
|
+
'MAX(kv.score) as maxVal',
|
|
336
|
+
'AVG(kv.score) as avgVal',
|
|
337
|
+
'STDDEV_POP(kv.score) as stddevVal',
|
|
338
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
339
|
+
])
|
|
340
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
341
|
+
.leftJoin('kpis', 'pk', 'k.parent_id = pk.id')
|
|
342
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
343
|
+
.where('p.end_date IS NOT NULL')
|
|
344
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
345
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
346
|
+
qb.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
347
|
+
}
|
|
348
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
349
|
+
qb.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
350
|
+
}
|
|
351
|
+
if (kpiNamePattern === null || kpiNamePattern === void 0 ? void 0 : kpiNamePattern.trim()) {
|
|
352
|
+
qb.andWhere('k.name LIKE :kpiNamePattern', { kpiNamePattern: `${kpiNamePattern}%` });
|
|
353
|
+
}
|
|
354
|
+
if (startYearMonth === null || startYearMonth === void 0 ? void 0 : startYearMonth.trim()) {
|
|
355
|
+
qb.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
356
|
+
}
|
|
357
|
+
if (endYearMonth === null || endYearMonth === void 0 ? void 0 : endYearMonth.trim()) {
|
|
358
|
+
qb.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
359
|
+
}
|
|
360
|
+
qb.groupBy('k.name, pk.name').orderBy('k.name', 'ASC');
|
|
361
|
+
const results = await qb.getRawMany();
|
|
362
|
+
const clamp = (v) => Math.min(Math.max(isNaN(v) ? 0 : v, 0), 1);
|
|
363
|
+
return results.map(r => ({
|
|
364
|
+
kpiName: r.kpiname,
|
|
365
|
+
categoryName: r.categoryname || undefined,
|
|
366
|
+
minVal: clamp(Number(r.minval)),
|
|
367
|
+
q1Val: clamp(Number(r.q1val)),
|
|
368
|
+
medVal: clamp(Number(r.medval)),
|
|
369
|
+
q3Val: clamp(Number(r.q3val)),
|
|
370
|
+
maxVal: clamp(Number(r.maxval)),
|
|
371
|
+
avgVal: clamp(Number(r.avgval)),
|
|
372
|
+
stddevVal: isNaN(Number(r.stddevval)) ? 0 : Math.max(0, Number(r.stddevval)),
|
|
373
|
+
projectCount: isNaN(Number(r.projectcount)) ? 0 : Number(r.projectcount)
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
async kpiZValueStatsBySigungu(kpiName, startYearMonth, endYearMonth, sectorType, buildingUsage, context) {
|
|
377
|
+
const { domain } = context.state;
|
|
378
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
379
|
+
.createQueryBuilder('kv')
|
|
380
|
+
.select([
|
|
381
|
+
'p.geo_group as geoGroup',
|
|
382
|
+
'MIN(kv.score) as minVal',
|
|
383
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
384
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
385
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
386
|
+
'MAX(kv.score) as maxVal',
|
|
387
|
+
'AVG(kv.score) as avgVal',
|
|
388
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
389
|
+
])
|
|
390
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
391
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
392
|
+
.where('p.end_date IS NOT NULL')
|
|
393
|
+
.andWhere('p.geo_group IS NOT NULL')
|
|
394
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
395
|
+
if (startYearMonth === null || startYearMonth === void 0 ? void 0 : startYearMonth.trim()) {
|
|
396
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
397
|
+
}
|
|
398
|
+
if (endYearMonth === null || endYearMonth === void 0 ? void 0 : endYearMonth.trim()) {
|
|
399
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
400
|
+
}
|
|
401
|
+
if (sectorType === null || sectorType === void 0 ? void 0 : sectorType.trim()) {
|
|
402
|
+
queryBuilder.andWhere('p.sector_type = :sectorType', { sectorType });
|
|
403
|
+
}
|
|
404
|
+
if (buildingUsage === null || buildingUsage === void 0 ? void 0 : buildingUsage.trim()) {
|
|
405
|
+
queryBuilder.andWhere('p.building_usage = :buildingUsage', { buildingUsage });
|
|
406
|
+
}
|
|
407
|
+
if (kpiName === null || kpiName === void 0 ? void 0 : kpiName.trim()) {
|
|
408
|
+
queryBuilder.andWhere('k.name = :kpiName', { kpiName });
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
queryBuilder.andWhere('k.name LIKE :pattern', { pattern: 'Z%' });
|
|
412
|
+
}
|
|
413
|
+
queryBuilder.groupBy('p.geo_group');
|
|
414
|
+
const results = await queryBuilder.getRawMany();
|
|
415
|
+
const clamp = (v) => Math.min(Math.max(isNaN(v) ? 0 : v, 0), 1);
|
|
416
|
+
return results
|
|
417
|
+
.map(r => ({
|
|
418
|
+
kpiName: r.kpiname || undefined,
|
|
419
|
+
geoGroup: r.geogroup || null,
|
|
420
|
+
minVal: clamp(Number(r.minval)),
|
|
421
|
+
q1Val: clamp(Number(r.q1val)),
|
|
422
|
+
medVal: clamp(Number(r.medval)),
|
|
423
|
+
q3Val: clamp(Number(r.q3val)),
|
|
424
|
+
maxVal: clamp(Number(r.maxval)),
|
|
425
|
+
avgVal: clamp(Number(r.avgval)),
|
|
426
|
+
projectCount: isNaN(Number(r.projectcount)) ? 0 : Number(r.projectcount)
|
|
427
|
+
}))
|
|
428
|
+
.filter(r => r.geoGroup !== null);
|
|
429
|
+
}
|
|
430
|
+
async kpiYValueStatsByGeoGroup(geoGroup, startYearMonth, endYearMonth, context) {
|
|
431
|
+
const { domain } = context.state;
|
|
432
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
433
|
+
.createQueryBuilder('kv')
|
|
434
|
+
.select([
|
|
435
|
+
'k.name as kpiName',
|
|
436
|
+
'MIN(kv.score) as minVal',
|
|
437
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
438
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
439
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
440
|
+
'MAX(kv.score) as maxVal',
|
|
441
|
+
'AVG(kv.score) as avgVal',
|
|
442
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
443
|
+
])
|
|
444
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
445
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
446
|
+
.where('k.name LIKE :pattern', { pattern: 'Y%' })
|
|
447
|
+
.andWhere('p.end_date IS NOT NULL')
|
|
448
|
+
.andWhere('p.geo_group = :geoGroup', { geoGroup })
|
|
449
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
450
|
+
if (startYearMonth === null || startYearMonth === void 0 ? void 0 : startYearMonth.trim()) {
|
|
451
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
452
|
+
}
|
|
453
|
+
if (endYearMonth === null || endYearMonth === void 0 ? void 0 : endYearMonth.trim()) {
|
|
454
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
455
|
+
}
|
|
456
|
+
queryBuilder.groupBy('k.name').orderBy('k.name', 'ASC');
|
|
457
|
+
const results = await queryBuilder.getRawMany();
|
|
458
|
+
const clamp = (v) => Math.min(Math.max(isNaN(v) ? 0 : v, 0), 1);
|
|
459
|
+
return results.map(r => ({
|
|
460
|
+
kpiName: r.kpiname,
|
|
461
|
+
minVal: clamp(Number(r.minval)),
|
|
462
|
+
q1Val: clamp(Number(r.q1val)),
|
|
463
|
+
medVal: clamp(Number(r.medval)),
|
|
464
|
+
q3Val: clamp(Number(r.q3val)),
|
|
465
|
+
maxVal: clamp(Number(r.maxval)),
|
|
466
|
+
avgVal: clamp(Number(r.avgval)),
|
|
467
|
+
projectCount: isNaN(Number(r.projectcount)) ? 0 : Number(r.projectcount)
|
|
468
|
+
}));
|
|
469
|
+
}
|
|
470
|
+
async kpiYValueStatsByMetroArea(metroArea, startYearMonth, endYearMonth, context) {
|
|
471
|
+
if (!context || !context.state) {
|
|
472
|
+
console.error('Context is undefined or missing state');
|
|
473
|
+
return [];
|
|
474
|
+
}
|
|
475
|
+
const { domain } = context.state;
|
|
476
|
+
const queryBuilder = (0, shell_1.getRepository)('kpi_values')
|
|
477
|
+
.createQueryBuilder('kv')
|
|
478
|
+
.select([
|
|
479
|
+
'k.name as kpiName',
|
|
480
|
+
'MIN(kv.score) as minVal',
|
|
481
|
+
'PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY kv.score) as q1Val',
|
|
482
|
+
'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY kv.score) as medVal',
|
|
483
|
+
'PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY kv.score) as q3Val',
|
|
484
|
+
'MAX(kv.score) as maxVal',
|
|
485
|
+
'AVG(kv.score) as avgVal',
|
|
486
|
+
'COUNT(DISTINCT p.id) as projectCount'
|
|
487
|
+
])
|
|
488
|
+
.innerJoin('kpis', 'k', 'kv.kpi_id = k.id')
|
|
489
|
+
.innerJoin('projects', 'p', 'kv.kpi_org_scope_id = p.id')
|
|
490
|
+
.where('k.name LIKE :pattern', { pattern: 'Y%' })
|
|
491
|
+
.andWhere('p.end_date IS NOT NULL')
|
|
492
|
+
.andWhere('p.geo_group IS NOT NULL')
|
|
493
|
+
.andWhere('kv.domain_id = :domainId', { domainId: domain.id });
|
|
494
|
+
// 기간 필터
|
|
495
|
+
if (startYearMonth && startYearMonth.trim() !== '') {
|
|
496
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') >= :startYearMonth`, { startYearMonth });
|
|
497
|
+
}
|
|
498
|
+
if (endYearMonth && endYearMonth.trim() !== '') {
|
|
499
|
+
queryBuilder.andWhere(`TO_CHAR(p.end_date, 'YYYY-MM') <= :endYearMonth`, { endYearMonth });
|
|
500
|
+
}
|
|
501
|
+
queryBuilder
|
|
502
|
+
.andWhere(`CASE
|
|
503
|
+
WHEN p.geo_group IN ('01','02','03','04','05','06','07','08') THEN '서울특별시'
|
|
504
|
+
WHEN p.geo_group IN ('46','47','48','49') THEN '부산광역시'
|
|
505
|
+
WHEN p.geo_group IN ('41','42','43') THEN '대구광역시'
|
|
506
|
+
WHEN p.geo_group IN ('21','22','23') THEN '인천광역시'
|
|
507
|
+
WHEN p.geo_group IN ('61','62') THEN '광주광역시'
|
|
508
|
+
WHEN p.geo_group IN ('34','35') THEN '대전광역시'
|
|
509
|
+
WHEN p.geo_group IN ('44','45') THEN '울산광역시'
|
|
510
|
+
WHEN p.geo_group = '30' THEN '세종특별자치시'
|
|
511
|
+
WHEN p.geo_group IN ('10','11','12','13','14','15','16','17','18') THEN '경기도'
|
|
512
|
+
WHEN p.geo_group IN ('24','25','26','33') THEN '강원도'
|
|
513
|
+
WHEN p.geo_group IN ('27','28','29') THEN '충청북도'
|
|
514
|
+
WHEN p.geo_group IN ('31','32') THEN '충청남도'
|
|
515
|
+
WHEN p.geo_group IN ('54','55','56') THEN '전라북도'
|
|
516
|
+
WHEN p.geo_group IN ('57','58','59') THEN '전라남도'
|
|
517
|
+
WHEN p.geo_group IN ('36','37','38','39','40') THEN '경상북도'
|
|
518
|
+
WHEN p.geo_group IN ('50','51','52','53') THEN '경상남도'
|
|
519
|
+
WHEN p.geo_group = '63' THEN '제주특별자치도'
|
|
520
|
+
END = :metroArea`, { metroArea })
|
|
521
|
+
.groupBy('k.name')
|
|
522
|
+
.orderBy('k.name', 'ASC');
|
|
523
|
+
const results = await queryBuilder.getRawMany();
|
|
524
|
+
return results.map(result => {
|
|
525
|
+
const kpiName = result.kpiname;
|
|
526
|
+
const minVal = Math.min(Math.max(Number(result.minval), 0), 1);
|
|
527
|
+
const q1Val = Math.min(Math.max(Number(result.q1val), 0), 1);
|
|
528
|
+
const medVal = Math.min(Math.max(Number(result.medval), 0), 1);
|
|
529
|
+
const q3Val = Math.min(Math.max(Number(result.q3val), 0), 1);
|
|
530
|
+
const avgVal = Math.min(Math.max(Number(result.avgval), 0), 1);
|
|
531
|
+
const maxVal = Math.min(Math.max(Number(result.maxval), 0), 1);
|
|
532
|
+
const projectCount = Number(result.projectcount);
|
|
533
|
+
return {
|
|
534
|
+
kpiName: kpiName,
|
|
535
|
+
minVal: isNaN(minVal) ? 0 : minVal,
|
|
536
|
+
q1Val: isNaN(q1Val) ? 0 : q1Val,
|
|
537
|
+
medVal: isNaN(medVal) ? 0 : medVal,
|
|
538
|
+
q3Val: isNaN(q3Val) ? 0 : q3Val,
|
|
539
|
+
maxVal: isNaN(maxVal) ? 0 : maxVal,
|
|
540
|
+
avgVal: isNaN(avgVal) ? 0 : avgVal,
|
|
541
|
+
projectCount: isNaN(projectCount) ? 0 : projectCount
|
|
542
|
+
};
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
exports.KpiStatQuery = KpiStatQuery;
|
|
547
|
+
tslib_1.__decorate([
|
|
548
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
549
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStats], { description: 'Get KPI box plot statistics for Z-category KPIs for all projects' }),
|
|
550
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
551
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
552
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
553
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
554
|
+
tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
|
|
555
|
+
tslib_1.__metadata("design:type", Function),
|
|
556
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, Object]),
|
|
557
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
558
|
+
], KpiStatQuery.prototype, "totalKpiZValueComprehensiveStats", null);
|
|
559
|
+
tslib_1.__decorate([
|
|
560
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
561
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStats], { description: 'Get KPI box plot statistics for Y-category KPIs for all projects' }),
|
|
562
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
563
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
564
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
565
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
566
|
+
tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
|
|
567
|
+
tslib_1.__metadata("design:type", Function),
|
|
568
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, Object]),
|
|
569
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
570
|
+
], KpiStatQuery.prototype, "totalKpiYValueComprehensiveStats", null);
|
|
571
|
+
tslib_1.__decorate([
|
|
572
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
573
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStatsByGeoGroup], {
|
|
574
|
+
description: 'Get KPI box plot statistics for Z-category KPIs by metro area'
|
|
575
|
+
}),
|
|
576
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('geoGroup', { nullable: true })),
|
|
577
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('kpiName', { nullable: true })),
|
|
578
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
579
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
580
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
581
|
+
tslib_1.__param(5, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
582
|
+
tslib_1.__param(6, (0, type_graphql_1.Ctx)()),
|
|
583
|
+
tslib_1.__metadata("design:type", Function),
|
|
584
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, String, Object]),
|
|
585
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
586
|
+
], KpiStatQuery.prototype, "kpiZValueComprehensiveStatsByGeoGroup", null);
|
|
587
|
+
tslib_1.__decorate([
|
|
588
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
589
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStatsByGeoGroup], { description: 'Get KPI box plot statistics for Y-category KPIs by geo group' }),
|
|
590
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('geoGroup', { nullable: true })),
|
|
591
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
592
|
+
tslib_1.__metadata("design:type", Function),
|
|
593
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
594
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
595
|
+
], KpiStatQuery.prototype, "kpiYValueComprehensiveStatsByGeoGroup", null);
|
|
596
|
+
tslib_1.__decorate([
|
|
597
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
598
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiMonthlyTrend], { description: 'Get monthly KPI trend for Z-category KPIs by metro area' }),
|
|
599
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiName', { nullable: true })),
|
|
600
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
601
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
602
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
603
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
604
|
+
tslib_1.__param(5, (0, type_graphql_1.Ctx)()),
|
|
605
|
+
tslib_1.__metadata("design:type", Function),
|
|
606
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, Object]),
|
|
607
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
608
|
+
], KpiStatQuery.prototype, "kpiZValueMonthlyTrendByGeoGroup", null);
|
|
609
|
+
tslib_1.__decorate([
|
|
610
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
611
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiProjectStat], { description: 'Get KPI stats aggregated from project data with optional sectorType/buildingUsage filters' }),
|
|
612
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
613
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
614
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('kpiNamePattern', { nullable: true })),
|
|
615
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
616
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
617
|
+
tslib_1.__param(5, (0, type_graphql_1.Ctx)()),
|
|
618
|
+
tslib_1.__metadata("design:type", Function),
|
|
619
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, Object]),
|
|
620
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
621
|
+
], KpiStatQuery.prototype, "kpiProjectStats", null);
|
|
622
|
+
tslib_1.__decorate([
|
|
623
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
624
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStatsByGeoGroup], {
|
|
625
|
+
description: 'Get KPI statistics by sigungu (geo_group code) level'
|
|
626
|
+
}),
|
|
627
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiName', { nullable: true })),
|
|
628
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
629
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
630
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('sectorType', { nullable: true })),
|
|
631
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('buildingUsage', { nullable: true })),
|
|
632
|
+
tslib_1.__param(5, (0, type_graphql_1.Ctx)()),
|
|
633
|
+
tslib_1.__metadata("design:type", Function),
|
|
634
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, Object]),
|
|
635
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
636
|
+
], KpiStatQuery.prototype, "kpiZValueStatsBySigungu", null);
|
|
637
|
+
tslib_1.__decorate([
|
|
638
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
639
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStats], { description: 'Get Y-level KPI statistics by geo_group code (sigungu)' }),
|
|
640
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('geoGroup')),
|
|
641
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
642
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
643
|
+
tslib_1.__param(3, (0, type_graphql_1.Ctx)()),
|
|
644
|
+
tslib_1.__metadata("design:type", Function),
|
|
645
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, Object]),
|
|
646
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
647
|
+
], KpiStatQuery.prototype, "kpiYValueStatsByGeoGroup", null);
|
|
648
|
+
tslib_1.__decorate([
|
|
649
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
650
|
+
(0, type_graphql_1.Query)(() => [kpi_stat_types_1.KpiComprehensiveStats], { description: 'Get KPI statistics for Y-category KPIs by specific metro area' }),
|
|
651
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('metroArea')),
|
|
652
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('startYearMonth', { nullable: true })),
|
|
653
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('endYearMonth', { nullable: true })),
|
|
654
|
+
tslib_1.__param(3, (0, type_graphql_1.Ctx)()),
|
|
655
|
+
tslib_1.__metadata("design:type", Function),
|
|
656
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, Object]),
|
|
657
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
658
|
+
], KpiStatQuery.prototype, "kpiYValueStatsByMetroArea", null);
|
|
659
|
+
exports.KpiStatQuery = KpiStatQuery = tslib_1.__decorate([
|
|
660
|
+
(0, type_graphql_1.Resolver)(kpi_1.KpiStatistic)
|
|
661
|
+
], KpiStatQuery);
|
|
662
|
+
//# sourceMappingURL=kpi-stat-query.js.map
|