clickhouse修复
This commit is contained in:
@@ -61,13 +61,20 @@ public sealed class ClickHouseAnalyticsController(
|
|||||||
GROUP BY attendanceDate ORDER BY attendanceDate
|
GROUP BY attendanceDate ORDER BY attendanceDate
|
||||||
""", cancellationToken);
|
""", cancellationToken);
|
||||||
var grades = await client.QueryAsync($"""
|
var grades = await client.QueryAsync($"""
|
||||||
|
SELECT academicTermId, academicTermName, studentCount,
|
||||||
|
round(weightedScore / nullIf(studentCount, 0), 2) AS averageScore,
|
||||||
|
round(passedCount / nullIf(studentCount, 0), 4) AS passRate
|
||||||
|
FROM
|
||||||
|
(
|
||||||
SELECT academicTermId, any(academicTermName) AS academicTermName,
|
SELECT academicTermId, any(academicTermName) AS academicTermName,
|
||||||
sum(studentCount) AS studentCount,
|
sum(studentCount) AS studentCount,
|
||||||
round(sum(averageScore * studentCount) / nullIf(sum(studentCount), 0), 2) AS averageScore,
|
sum(averageScore * studentCount) AS weightedScore,
|
||||||
round(sum(passedCount) / nullIf(sum(studentCount), 0), 4) AS passRate
|
sum(passedCount) AS passedCount
|
||||||
FROM {options.Database}.gradeStatistics FINAL
|
FROM {options.Database}.gradeStatistics FINAL
|
||||||
WHERE 1 = 1{collegeFilter}
|
WHERE 1 = 1{collegeFilter}
|
||||||
GROUP BY academicTermId ORDER BY academicTermName
|
GROUP BY academicTermId
|
||||||
|
)
|
||||||
|
ORDER BY academicTermName
|
||||||
""", cancellationToken);
|
""", cancellationToken);
|
||||||
|
|
||||||
// Audit data has no college dimension, so it is never exposed to a
|
// Audit data has no college dimension, so it is never exposed to a
|
||||||
|
|||||||
Reference in New Issue
Block a user