phase 5 complete, sending to QA and code review

This commit is contained in:
2026-08-17 21:20:35 +01:00
parent 06886a2286
commit 4ef3ca706a
6 changed files with 309 additions and 79 deletions
+3 -3
View File
@@ -263,7 +263,7 @@ async fn get_summary(
let conn = conn.blocking_lock();
let where_clause = if species_filter.is_some() {
" WHERE species_code = ?".to_string()
" AND species_code = ?".to_string()
} else {
String::new()
};
@@ -272,7 +272,7 @@ async fn get_summary(
"SELECT month, \
SUM(CASE WHEN measure_code = 'MASS' THEN value END) AS total_mass, \
SUM(CASE WHEN measure_code = 'VALUE' THEN value END) AS total_value \
FROM landings{where_clause} \
FROM landings WHERE 1=1{where_clause} \
GROUP BY month ORDER BY month"
);
@@ -307,7 +307,7 @@ async fn get_summary(
COALESCE(MAX(species_label), species_code) AS species_label, \
SUM(CASE WHEN measure_code = 'VALUE' THEN value END) AS total_value, \
SUM(CASE WHEN measure_code = 'MASS' THEN value END) AS total_mass \
FROM landings{where_clause} \
FROM landings WHERE 1=1{where_clause} \
GROUP BY species_code, species_label \
ORDER BY total_value DESC NULLS LAST \
LIMIT 10"