Commit 18923c24 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Tâche #25025

Univers BO : Préparer les vues matérialisées
parent 883cd218
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -11,7 +11,12 @@ $ddlConfig = [
    'primary-constraint' => ['excludes' => 'UNICAEN_%'],
    'index'              => ['excludes' => 'UNICAEN_%'],
    'view'               => ['excludes' => ['SRC_%', 'V_DIFF_%', 'V_SYMPA_%', 'V_UNICAEN_%']],
    'materialized-view'  => ['includes' => ['MV_EXT_SERVICE', 'TBL_NOEUD']],
    'materialized-view'  => ['includes' => [
        'MV_EXT_SERVICE',
        'MV_EXT_DOTATION_LIQUIDATION',
        'MV_EXT_ETAT_PAIEMENT',
        'TBL_NOEUD'
    ]],
    'package'            => ['excludes' => ['UCBN_LDAP', 'UNICAEN_IMPORT_AUTOGEN_PROCS__']],
];

+72 −18
Original line number Diff line number Diff line
@@ -13312,7 +13312,7 @@
      'name' => 'TBL_AGREMENT',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Gestion des agréments',
      'sequence' => 'TBL_AGREMENT_ID_SEQ',
      'columns' => 
      array (
@@ -13411,7 +13411,7 @@
      'name' => 'TBL_CHARGENS',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Charges d\'enseignement',
      'sequence' => 'TBL_CHARGENS_ID_SEQ',
      'columns' => 
      array (
@@ -13642,7 +13642,7 @@
      'name' => 'TBL_CHARGENS_SEUILS_DEF',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Pré-calculs des seuils par défaut',
      'sequence' => 'TBL_CHARGENS_SEUILS_DEF_ID_SEQ',
      'columns' => 
      array (
@@ -13741,7 +13741,7 @@
      'name' => 'TBL_CLOTURE_REALISE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Clôture de saisie du service réalisé par les intervenants',
      'sequence' => 'TBL_CLOTURE_REALISE_ID_SEQ',
      'columns' => 
      array (
@@ -13818,7 +13818,7 @@
      'name' => 'TBL_CONTRAT',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Contrats de travail',
      'sequence' => 'TBL_CONTRAT_ID_SEQ',
      'columns' => 
      array (
@@ -14082,7 +14082,7 @@
      'name' => 'TBL_DMEP_LIQUIDATION',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Gestion budgétaire (enveloppes)',
      'sequence' => 'TBL_DMEP_LIQUIDATION_ID_SEQ',
      'columns' => 
      array (
@@ -14159,7 +14159,7 @@
      'name' => 'TBL_DOSSIER',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Données personnelles',
      'sequence' => 'TBL_DOSSIER_ID_SEQ',
      'columns' => 
      array (
@@ -14247,7 +14247,7 @@
      'name' => 'TBL_LIEN',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Liens (pour les charges d\'enseignement)',
      'sequence' => 'TBL_LIEN_ID_SEQ',
      'columns' => 
      array (
@@ -14423,7 +14423,7 @@
      'name' => 'TBL_PAIEMENT',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Données liées aux paiements et demandes de mises en paiement',
      'sequence' => 'TBL_PAIEMENT_ID_SEQ',
      'columns' => 
      array (
@@ -14599,7 +14599,7 @@
      'name' => 'TBL_PIECE_JOINTE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Pièces justificatives',
      'sequence' => 'TBL_PIECE_JOINTE_ID_SEQ',
      'columns' => 
      array (
@@ -14709,7 +14709,7 @@
      'name' => 'TBL_PIECE_JOINTE_DEMANDE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Pièces justificatives (demandes)',
      'sequence' => 'TBL_PIECE_JOINTE_DEMAND_ID_SEQ',
      'columns' => 
      array (
@@ -14786,7 +14786,7 @@
      'name' => 'TBL_PIECE_JOINTE_FOURNIE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Pièces justificatives fournies',
      'sequence' => 'TBL_PIECE_JOINTE_FOURNI_ID_SEQ',
      'columns' => 
      array (
@@ -14885,7 +14885,7 @@
      'name' => 'TBL_SERVICE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Services d\'ensiegnement',
      'sequence' => 'TBL_SERVICE_ID_SEQ',
      'columns' => 
      array (
@@ -15127,7 +15127,7 @@
      'name' => 'TBL_SERVICE_REFERENTIEL',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Référentiel',
      'sequence' => 'TBL_SERVICE_REFERENTIEL_ID_SEQ',
      'columns' => 
      array (
@@ -15237,7 +15237,7 @@
      'name' => 'TBL_SERVICE_SAISIE',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Service (pour alimenter le Workflow)',
      'sequence' => 'TBL_SERVICE_SAISIE_ID_SEQ',
      'columns' => 
      array (
@@ -15358,7 +15358,7 @@
      'name' => 'TBL_VALIDATION_ENSEIGNEMENT',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Suivi des validations de services',
      'sequence' => 'TBL_VALIDATION_ENSEIGNE_ID_SEQ',
      'columns' => 
      array (
@@ -15479,7 +15479,7 @@
      'name' => 'TBL_VALIDATION_REFERENTIEL',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Suivi des validations du référentiel',
      'sequence' => 'TBL_VALIDATION_REFERENT_ID_SEQ',
      'columns' => 
      array (
@@ -15600,7 +15600,7 @@
      'name' => 'TBL_WORKFLOW',
      'temporary' => false,
      'logging' => false,
      'commentaire' => NULL,
      'commentaire' => 'Workflow (feuilles de routes : avancement par étape par intervenant et le cas échéant par composante)',
      'sequence' => 'TBL_WORKFLOW_ID_SEQ',
      'columns' => 
      array (
@@ -36118,6 +36118,60 @@ WHERE
  ),
  'BddAdmin\\Ddl\\DdlMaterializedView' => 
  array (
    'MV_EXT_DOTATION_LIQUIDATION' => 
    array (
      'name' => 'MV_EXT_DOTATION_LIQUIDATION',
      'definition' => 'SELECT
	COALESCE(HEURE_DOT.ANNEE_ID,HEURE_LIQUID.ANNEE_ID) ANNEE_ID,
	COALESCE(HEURE_DOT.TYPE_RESSOURCE_ID, HEURE_LIQUID.TYPE_RESSOURCE_ID) TYPE_RESSOURCE_ID,
	COALESCE(HEURE_DOT.STRUCTURE_ID, HEURE_LIQUID.STRUCTURE_ID) STRUCTURE_ID,
	SUM(HEURE_DOT.HEURES) HEURES_D,
	SUM(HEURE_LIQUID.HEURES) HEURES_L
FROM
	(
		SELECT
			DOTATION.ANNEE_ID,
			DOTATION.TYPE_RESSOURCE_ID,
			DOTATION.STRUCTURE_ID,
			SUM(
				CASE
					WHEN DOTATION.HISTO_DESTRUCTION IS NULL THEN DOTATION.HEURES
					ELSE 0.0
				END
			) HEURES
		FROM
			DOTATION
		GROUP BY
			DOTATION.ANNEE_ID,
			DOTATION.TYPE_RESSOURCE_ID,
			DOTATION.STRUCTURE_ID
	) HEURE_DOT
	FULL OUTER JOIN (
		SELECT
			V_TBL_DMEP_LIQUIDATION.ANNEE_ID,
			V_TBL_DMEP_LIQUIDATION.TYPE_RESSOURCE_ID,
			V_TBL_DMEP_LIQUIDATION.STRUCTURE_ID,
			SUM(V_TBL_DMEP_LIQUIDATION.HEURES) HEURES
		FROM
			V_TBL_DMEP_LIQUIDATION
		GROUP BY
			V_TBL_DMEP_LIQUIDATION.ANNEE_ID,
			V_TBL_DMEP_LIQUIDATION.TYPE_RESSOURCE_ID,
			V_TBL_DMEP_LIQUIDATION.STRUCTURE_ID
	) HEURE_LIQUID
		ON HEURE_DOT.ANNEE_ID = HEURE_LIQUID.ANNEE_ID
		AND HEURE_DOT.TYPE_RESSOURCE_ID = HEURE_LIQUID.TYPE_RESSOURCE_ID
		AND HEURE_DOT.STRUCTURE_ID = HEURE_LIQUID.STRUCTURE_ID
GROUP BY
	COALESCE(HEURE_DOT.ANNEE_ID,HEURE_LIQUID.ANNEE_ID),
	COALESCE(HEURE_DOT.TYPE_RESSOURCE_ID, HEURE_LIQUID.TYPE_RESSOURCE_ID),
	COALESCE(HEURE_DOT.STRUCTURE_ID, HEURE_LIQUID.STRUCTURE_ID)',
    ),
    'MV_EXT_ETAT_PAIEMENT' => 
    array (
      'name' => 'MV_EXT_ETAT_PAIEMENT',
      'definition' => 'SELECT * FROM v_etat_paiement',
    ),
    'MV_EXT_SERVICE' => 
    array (
      'name' => 'MV_EXT_SERVICE',
+1 −17
Original line number Diff line number Diff line
@@ -206,7 +206,6 @@ Contrats de travail
|SIGNE             |Nombre de volumes horaires signés                         |



## Table TBL_DMEP_LIQUIDATION

Gestion budgétaire (enveloppes)
@@ -218,7 +217,6 @@ Gestion budgétaire (enveloppes)
|TYPE_RESSOURCE_ID|==> TYPE_RESSOURCE.ID|
|STRUCTURE_ID     |==> STRUCTURE.ID     |
|HEURES           |                     |
|TO_DELETE        |                     |


## Table TBL_DOSSIER
@@ -233,7 +231,6 @@ Données personnelles
|PEUT_SAISIR_DOSSIER|1 Si l'intervenant a un dossier, 0 sinon|
|DOSSIER_ID         |==> DOSSIER.ID                          |
|VALIDATION_ID      |==> VALIDATION.ID                       |
|TO_DELETE          |                                        |


## Table TBL_LIEN
@@ -255,7 +252,6 @@ Liens (pour les charges d'enseignement)
|CHOIX_MAXIMUM   |Choix maximum              |
|NB_CHOIX        |Nombre de choix            |
|TOTAL_POIDS     |Total de poids des fils    |
|TO_DELETE       |                           |
|MAX_POIDS       |Poids maximum pour les fils|


@@ -271,7 +267,6 @@ Données liées aux paiements et demandes de mises en paiement
|STRUCTURE_ID              |==> STRUCTURE.ID                   |
|MISE_EN_PAIEMENT_ID       |==> MISE_EN_PAIEMENT.ID            |
|PERIODE_PAIEMENT_ID       |==> PERIODE.ID                     |
|TO_DELETE                 |                                   |
|HEURES_A_PAYER            |HETD à payer                       |
|HEURES_A_PAYER_POND       |HETD à payer (en %)                |
|HEURES_DEMANDEES          |HETD demandées                     |
@@ -295,7 +290,6 @@ Pièces justificatives
|DEMANDEE            |Témoin (1 si la PJ est demandée)    |
|FOURNIE             |Témoin (1 si la PJ est fournie)     |
|VALIDEE             |Témoin (1 si la PJ est validée)     |
|TO_DELETE           |                                    |
|HEURES_POUR_SEUIL   |NB d'heures de seuil pour la demande|


@@ -309,7 +303,6 @@ Pièces justificatives (demandes)
|ANNEE_ID            |==> ANNEE.ID            |
|TYPE_PIECE_JOINTE_ID|==> TYPE_PIECE_JOINTE.ID|
|INTERVENANT_ID      |==> INTERVENANT.ID      |
|TO_DELETE           |                        |
|HEURES_POUR_SEUIL   |                        |


@@ -325,7 +318,6 @@ Pièces justificatives fournies
|INTERVENANT_ID      |==> INTERVENANT.ID      |
|VALIDATION_ID       |==> VALIDATION.ID       |
|FICHIER_ID          |==> FICHIER.ID          |
|TO_DELETE           |                        |
|PIECE_JOINTE_ID     |==> PIECE_JOINTE.ID     |


@@ -343,7 +335,6 @@ Services d'ensiegnement
|STRUCTURE_ID                  |==> STRUCTURE.ID                                |
|NBVH                          |Nombre de volumes horaires saisis               |
|VALIDE                        |Nombre de volumes horaires validés              |
|TO_DELETE                     |                                                |
|ELEMENT_PEDAGOGIQUE_ID        |==> ELEMENT_PEDAGOGIQUE.ID                      |
|ELEMENT_PEDAGOGIQUE_PERIODE_ID|==> PERIODE.ID                                  |
|ETAPE_ID                      |==> ETAPE.ID                                    |
@@ -372,7 +363,6 @@ Référentiel
|STRUCTURE_ID          |==> STRUCTURE.ID                     |
|NBVH                  |Nombre de volumes horaires           |
|VALIDE                |Nombre de volumes horaires validés   |
|TO_DELETE             |                                     |


## Table TBL_SERVICE_SAISIE
@@ -390,7 +380,6 @@ Service (pour alimenter le Workflow)
|HEURES_REFERENTIEL_PREV|NB d'heures de référentiel prévisionnel|
|HEURES_SERVICE_REAL    |NB d'heures de service réalisé         |
|HEURES_REFERENTIEL_REAL|NB d'heures de référentiel réalisé     |
|TO_DELETE              |                                       |


## Table TBL_VALIDATION_ENSEIGNEMENT
@@ -406,7 +395,6 @@ Suivi des validations de services
|TYPE_VOLUME_HORAIRE_ID|==> TYPE_VOLUME_HORAIRE.ID   |
|SERVICE_ID            |==> SERVICE.ID               |
|VALIDATION_ID         |==> VALIDATION.ID (Si validé)|
|TO_DELETE             |                             |
|VOLUME_HORAIRE_ID     |==> VOLUME_HORAIRE.ID        |
|AUTO_VALIDATION       |Témoin (0 ou 1)              |

@@ -424,7 +412,6 @@ Suivi des validations du référentiel
|TYPE_VOLUME_HORAIRE_ID|==> TYPE_VOLUME_HORAIRE.ID   |
|SERVICE_REFERENTIEL_ID|==> SERVICE_REFERENTIEL.ID   |
|VALIDATION_ID         |==> VALIDATION.ID (Si validé)|
|TO_DELETE             |                             |
|VOLUME_HORAIRE_REF_ID |==> VOLUME_HORAIRE_REF.ID    |
|AUTO_VALIDATION       |Témoin (0 ou 1)              |

@@ -440,7 +427,6 @@ Workflow (feuilles de routes : avancement par étape par intervenant et le cas
|ETAPE_ID             |==> WF_ETAPE.ID (Identifiant de l'étape concernée)              |
|STRUCTURE_ID         |==> STRUCTURE.ID (Eventuelle structure concernée)               |
|ATTEIGNABLE          |Témoin indiquant si l'étape est atteignable ou non              |
|TO_DELETE            |                                                                |
|REALISATION          |Pourcentage de réalisation de l'étape de Workflow (entre 0 et 1)|
|OBJECTIF             |Objectif de réalisation de l'étape de Workflow (entre 0 et 1)   |
|ANNEE_ID             |==> ANNEE.ID                                                    |
@@ -448,5 +434,3 @@ Workflow (feuilles de routes : avancement par étape par intervenant et le cas
|TYPE_INTERVENANT_CODE|Code du type d'intevention (CM / TD / TP, etc)                  |
|ETAPE_CODE           |Code de l'étape du workflow concernée                           |
|STATUT_INTERVENANT_ID|==> STATUT_INTERVENANT.ID                                       |
 No newline at end of file