From afce4e28b1ff80c4340ec9ef43172e900a51dfb2 Mon Sep 17 00:00:00 2001 From: "amandine.sahl" Date: Thu, 3 Sep 2020 17:25:56 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20sensibilit=C3=A9=20par=20d=C3=A9faut=20?= =?UTF-8?q?-=20cf=20#14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/view_synthese.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/view_synthese.sql b/data/view_synthese.sql index 1d34c95..b15c49f 100644 --- a/data/view_synthese.sql +++ b/data/view_synthese.sql @@ -17,6 +17,7 @@ SELECT v.uuid_base_visit as unique_id_sinp_grp, (SELECT id_source FROM source) as id_source, ccc.id_counting_contact as entity_source_pk_value, + s.uuid_base_site, v.id_dataset as id_dataset, v.id_module as id_module, -- MISSING FIELD id_nomenclature_geo_object_nature, @@ -28,12 +29,15 @@ vct.id_nomenclature_bio_condition as id_nomenclature_bio_condition, -- MISSING FIELD id_nomenclature_naturalness, -- MISSING FIELD id_nomenclature_exist_proof, -- MISSING FIELD id_nomenclature_diffusion_level, +CASE + WHEN NOT s.uuid_base_site IS NULL THEN sr.id_nomenclature_sensitivity + ELSE NULL +END as id_nomenclature_sensitivity, -- cas des sites => données sensibiles quelque soit le critère ccc.id_nomenclature_life_stage, ccc.id_nomenclature_sex, ccc.id_nomenclature_obj_count, ccc.id_nomenclature_type_count, vct.id_nomenclature_observation_status, --- MISSING FIELD id_nomenclature_observation_status, -- MISSING FIELD id_nomenclature_blurring, -- MISSING FIELD id_nomenclature_source_status, -- MISSING FIELD id_nomenclature_info_geo_type, @@ -77,4 +81,6 @@ LEFT OUTER JOIN ( ) obs ON obs.id_base_visit = v.id_base_visit LEFT OUTER JOIN cor_nom_act_comp cnac -ON cnac.id_nomenclature_act = vct.id_nomenclature_behaviour ; +ON cnac.id_nomenclature_act = vct.id_nomenclature_behaviour +LEFT OUTER JOIN gn_sensitivity.t_sensitivity_rules_cd_ref sr +ON sr.cd_ref = t.cd_ref;