Skip to content
Snippets Groups Projects
Commit 6d2975cb authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files
parent 292bffd2
No related branches found
No related tags found
No related merge requests found
...@@ -323,7 +323,7 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS ...@@ -323,7 +323,7 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
(WITH i_s AS ( (WITH i_s AS (
SELECT SELECT
fr.intervenant_id, fr.intervenant_id,
ep.structure_id ep.structure_id ep_structure_id
FROM FROM
formule_resultat fr formule_resultat fr
JOIN type_volume_horaire tvh ON tvh.code = ''PREVU'' AND tvh.id = fr.type_volume_horaire_id JOIN type_volume_horaire tvh ON tvh.code = ''PREVU'' AND tvh.id = fr.type_volume_horaire_id
...@@ -410,7 +410,7 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS ...@@ -410,7 +410,7 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
NVL(a.id, avi.agrement_id) agrement_id, NVL(a.id, avi.agrement_id) agrement_id,
tas.duree_vie duree_vie, tas.duree_vie duree_vie,
RANK() OVER( RANK() OVER(
PARTITION BY i.code,i.annee_id ORDER BY PARTITION BY i.code,i.annee_id,i_s.ep_structure_id ORDER BY
CASE CASE
WHEN NVL(NVL(a.id, avi.agrement_id),0) = 0 WHEN NVL(NVL(a.id, avi.agrement_id),0) = 0
THEN NULL THEN NULL
...@@ -427,11 +427,13 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS ...@@ -427,11 +427,13 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
JOIN i_s ON i_s.intervenant_id = i.id JOIN i_s ON i_s.intervenant_id = i.id
LEFT JOIN agrement a ON a.type_agrement_id = ta.id LEFT JOIN agrement a ON a.type_agrement_id = ta.id
AND a.structure_id = i_s.ep_structure_id
AND a.intervenant_id = i.id AND a.intervenant_id = i.id
AND a.histo_destruction IS NULL AND a.histo_destruction IS NULL
LEFT JOIN avi ON i.code = avi.code_intervenant LEFT JOIN avi ON i.code = avi.code_intervenant
AND tas.type_agrement_id = avi.type_agrement AND tas.type_agrement_id = avi.type_agrement
AND a.id = avi.agrement_id
AND i.annee_id < avi.date_validite AND i.annee_id < avi.date_validite
AND i.annee_id >= avi.annee_id AND i.annee_id >= avi.annee_id
......
...@@ -2,7 +2,7 @@ CREATE OR REPLACE FORCE VIEW V_TBL_AGREMENT AS ...@@ -2,7 +2,7 @@ CREATE OR REPLACE FORCE VIEW V_TBL_AGREMENT AS
WITH i_s AS ( WITH i_s AS (
SELECT SELECT
fr.intervenant_id, fr.intervenant_id,
ep.structure_id ep.structure_id ep_structure_id
FROM FROM
formule_resultat fr formule_resultat fr
JOIN type_volume_horaire tvh ON tvh.code = 'PREVU' AND tvh.id = fr.type_volume_horaire_id JOIN type_volume_horaire tvh ON tvh.code = 'PREVU' AND tvh.id = fr.type_volume_horaire_id
...@@ -89,7 +89,7 @@ SELECT DISTINCT "ANNEE_ID","ANNEE_AGREMENT","TYPE_AGREMENT_ID","INTERVENANT_ID", ...@@ -89,7 +89,7 @@ SELECT DISTINCT "ANNEE_ID","ANNEE_AGREMENT","TYPE_AGREMENT_ID","INTERVENANT_ID",
NVL(a.id, avi.agrement_id) agrement_id, NVL(a.id, avi.agrement_id) agrement_id,
tas.duree_vie duree_vie, tas.duree_vie duree_vie,
RANK() OVER( RANK() OVER(
PARTITION BY i.code,i.annee_id ORDER BY PARTITION BY i.code,i.annee_id,i_s.ep_structure_id ORDER BY
CASE CASE
WHEN NVL(NVL(a.id, avi.agrement_id),0) = 0 WHEN NVL(NVL(a.id, avi.agrement_id),0) = 0
THEN NULL THEN NULL
...@@ -106,11 +106,13 @@ SELECT DISTINCT "ANNEE_ID","ANNEE_AGREMENT","TYPE_AGREMENT_ID","INTERVENANT_ID", ...@@ -106,11 +106,13 @@ SELECT DISTINCT "ANNEE_ID","ANNEE_AGREMENT","TYPE_AGREMENT_ID","INTERVENANT_ID",
JOIN i_s ON i_s.intervenant_id = i.id JOIN i_s ON i_s.intervenant_id = i.id
LEFT JOIN agrement a ON a.type_agrement_id = ta.id LEFT JOIN agrement a ON a.type_agrement_id = ta.id
AND a.structure_id = i_s.ep_structure_id
AND a.intervenant_id = i.id AND a.intervenant_id = i.id
AND a.histo_destruction IS NULL AND a.histo_destruction IS NULL
LEFT JOIN avi ON i.code = avi.code_intervenant LEFT JOIN avi ON i.code = avi.code_intervenant
AND tas.type_agrement_id = avi.type_agrement AND tas.type_agrement_id = avi.type_agrement
AND a.id = avi.agrement_id
AND i.annee_id < avi.date_validite AND i.annee_id < avi.date_validite
AND i.annee_id >= avi.annee_id AND i.annee_id >= avi.annee_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment