-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Les données d'actions de mission ne sont pas toujours complétées #3527
Comments
Suggestions :
|
Update le 20/08/2024 Reste à faire
|
Requête pour voir les champs obligatoires non remplis sur les missions TO_COMPLETE : SELECT
action_type,
COUNT(*) AS nb_actions,
SUM(CASE WHEN port_locode IS NOT NULL THEN 1 END) AS non_null_port_locode,
SUM(CASE WHEN vessel_name IS NOT NULL THEN 1 END) AS non_null_vessel_name,
SUM(CASE WHEN latitude IS NOT NULL THEN 1 END) AS non_null_latitude,
SUM(CASE WHEN longitude IS NOT NULL THEN 1 END) AS non_null_longitude,
SUM(CASE WHEN emits_vms IS NOT NULL THEN 1 END) AS non_null_emits_vms,
SUM(CASE WHEN emits_ais IS NOT NULL THEN 1 END) AS non_null_emits_ais,
SUM(CASE WHEN logbook_matches_activity IS NOT NULL THEN 1 END) AS non_null_logbook_matches_activity,
SUM(CASE WHEN licences_match_activity IS NOT NULL THEN 1 END) AS non_null_licences_match_activity,
SUM(CASE WHEN species_size_controlled IS NOT NULL THEN 1 END) AS non_null_species_size_controlled,
SUM(CASE WHEN species_weight_controlled IS NOT NULL THEN 1 END) AS non_null_species_weight_controlled,
SUM(CASE WHEN separate_stowage_of_preserved_species IS NOT NULL THEN 1 END) AS non_null_separate_stowage_of_preserved_species,
SUM(CASE WHEN gear_onboard IS NOT NULL THEN 1 END) AS non_null_gear_onboard,
SUM(CASE WHEN (SELECT SUM(CASE WHEN gear->>'gearWasControlled' IS NULL THEN 1 END) FROM jsonb_array_elements(gear_onboard) gear) > 0 THEN 1 END) AS has_gear_with_null_gear_was_controlled,
SUM(CASE WHEN vessel_targeted IS NOT NULL THEN 1 END) AS non_null_vessel_targeted,
SUM(CASE WHEN user_trigram IS NOT NULL THEN 1 END) AS non_null_user_trigram,
SUM(CASE WHEN completed_by IS NOT NULL THEN 1 END) AS non_null_completed_by
FROM mission_actions a
JOIN analytics_missions m
ON a.mission_id = m.id
WHERE
action_datetime_utc < '2024-01-01'
AND completion = 'TO_COMPLETE'
AND NOT is_deleted
AND action_type IN ('SEA_CONTROL', 'AIR_CONTROL', 'LAND_CONTROL' ,'AIR_SURVEILLANCE')
AND NOT m.deleted
GROUP BY 1 Requête pour voir les actions TO_COMPLETE alors que tous les champs obligatoires sont remplis : SELECT
a.*
FROM mission_actions a
JOIN analytics_missions m
ON a.mission_id = m.id
WHERE
action_datetime_utc < '2024-01-01'
AND completion = 'TO_COMPLETE'
AND NOT is_deleted
AND action_type IN ('SEA_CONTROL', 'LAND_CONTROL')
AND NOT m.deleted
AND (
(port_locode IS NOT NULL AND action_type = 'LAND_CONTROL')
OR
(latitude IS NOT NULL AND longitude IS NOT NULL AND action_type = 'SEA_CONTROL')
)
AND vessel_name IS NOT NULL
AND emits_vms IS NOT NULL
AND emits_ais IS NOT NULL
AND logbook_matches_activity IS NOT NULL
AND licences_match_activity IS NOT NULL
AND species_size_controlled IS NOT NULL
AND species_weight_controlled IS NOT NULL
AND separate_stowage_of_preserved_species IS NOT NULL
AND gear_onboard IS NOT NULL
AND (SELECT COALESCE(SUM(CASE WHEN gear->>'gearWasControlled' IS NULL THEN 1 END), 0) FROM jsonb_array_elements(gear_onboard) gear) = 0
AND vessel_targeted IS NOT NULL
AND user_trigram IS NOT NULL
AND completed_by IS NOT NULL |
@VincentAntoine merci pour ce check, c'est vrai qu'on avait moins suivi jusqu'ici cette question de complétion des données côté Fish. |
Depuis le switch à Monitorfish (07/2023), certaines actions non complétées passent à travers les mailles du filet chaque mois :
@AdelineCelier
The text was updated successfully, but these errors were encountered: