Пример #1
0
 protected function getEm($entity, Multi $filtre)
 {
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT e.*, \n                uo.regroupement_programme_code, uo.regroupement_programme_libelle\n            FROM emargement_aqu as e\n            LEFT JOIN unite_ouverte_aqu as uo ON uo.centre_code = e.centre_code \n                AND uo.annee = e.annee \n                AND uo.unite_numero = e.unite_numero\n                AND uo.semestre_code = e.semestre_code\n                AND uo.groupe_code = e.groupe_code";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql('e.');
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     return $em;
 }
Пример #2
0
 public function getEm($entity, Multi $filtre)
 {
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT    p.*,\n                          i.inscription_date,\n                          i.centre_attachement_libelle,\n                          iu.inscription_unite_date_creation,\n                          iu.modalite,\n                          iu.groupe_code,\n                          iu.sousgroupe_code,\n                          u.unite_code,\n                          u.unite_nb_heure,\n                          u.unite_ects,\n                          uo.regroupement_programme_code,\n                          uo.regroupement_programme_libelle,\n                          i.formation_numero,\n                          i.formation_libelle\n                FROM      prise_en_charge_aqu p\n                LEFT JOIN inscription_aqu i\n                ON        i.centre_code     = 285\n                AND       i.auditeur_numero = p.auditeur_numero\n                AND       i.annee           = p.annee\n                LEFT JOIN inscription_unite_aqu iu\n                ON        iu.centre_code     = i.centre_code\n                AND       iu.unite_numero    = p.unite_numero\n                AND       iu.auditeur_numero = i.auditeur_numero\n                AND       iu.annee           = i.annee\n                AND       iu.semestre_code   = p.semestre_code\n                LEFT JOIN unite_aqu u\n                ON        u.unite_numero = iu.unite_numero\n                LEFT JOIN unite_ouverte_aqu uo\n                ON        uo.centre_code   = iu.centre_code\n                AND       uo.annee         = iu.annee\n                AND       uo.unite_numero  = iu.unite_numero\n                AND       uo.semestre_code = iu.semestre_code\n                AND       uo.groupe_code   = iu.groupe_code";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql('p.');
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     return $em;
 }
Пример #3
0
 public function getEm($entity, Multi $filtre)
 {
     /** @var Manager $em */
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT DISTINCT\n                          ev.*,\n                          em.emargement_heures_presence AS heures_realisees\n                FROM      evenement_aqu ev\n                LEFT JOIN emargement_aqu em\n                ON        em.evenement_code = ev.evenement_code";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql('ev.');
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     return $em;
 }
Пример #4
0
 public function getEm($entity, Multi $filtre)
 {
     /** @var Manager $em */
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT    *\n                FROM      (\n                    SELECT    iu.*,\n                              u.unite_nb_heure,\n                              uo.regroupement_programme_code,\n                              uo.regroupement_programme_libelle\n                    FROM      inscription_unite_aqu iu\n                    JOIN      unite_aqu u\n                    ON        u.unite_numero = iu.unite_numero\n                    LEFT JOIN unite_ouverte_aqu uo\n                    ON        uo.centre_code = iu.centre_code\n                    AND       uo.annee = iu.annee\n                    AND       uo.semestre_code = iu.semestre_code\n                    AND       uo.unite_numero = iu.unite_numero\n                    AND       uo.groupe_code = iu.groupe_code\n                ) inscriptions";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql('inscriptions.');
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     return $em;
 }
Пример #5
0
 /**
  * @param string $entity
  * @param Multi $filtre
  * @return array
  */
 public function getArrayData($entity, Multi $filtre)
 {
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT i.*, a.*, insc.*, uo.*, u.*, d.*\n            FROM inscription_unite_aqu as i\n            LEFT JOIN auditeur_aqu as a ON a.auditeur_numero = i.auditeur_numero\n            LEFT JOIN unite_ouverte_aqu as uo ON uo.centre_code = i.centre_code AND uo.annee = i.annee\n              AND uo.unite_numero = i.unite_numero AND uo.groupe_code = i.groupe_code \n              AND uo.semestre_code = i.semestre_code\n            LEFT JOIN inscription_aqu as insc ON insc.annee = i.annee \n              AND insc.centre_code = i.centre_code AND insc.auditeur_numero = i.auditeur_numero\n            LEFT JOIN unite_aqu as u ON u.unite_numero = uo.unite_numero\n            LEFT JOIN diplome_cnam_aqu as d ON d.diplome_numero = insc.inscription_diplome_prepare_numero";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql('i.');
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     $result = $em->getArrayData('\\Zac2\\Domain\\' . ucfirst($entity), $filtre);
     return $result;
 }
Пример #6
0
 /**
  * @param string $entity
  * @param Multi $filtre
  * @return array
  */
 public function getArrayData($entity, Multi $filtre)
 {
     $em = $this->getDic()->get('entitymanager.gescicca.requeteur');
     $dataRequest = new SqlString();
     // le filtrage doit être appliqué ici à la main
     $sql = "SELECT    facture_detail_aqu.facture_detail_numero,\n                          facture_detail_aqu.facture_numero,\n                          facture_detail_aqu.annee,\n                          facture_detail_aqu.annee_universitaire,\n                          facture_detail_aqu.type_article,\n                          facture_detail_aqu.type_facture,\n                          facture_detail_aqu.article_numero,\n                          facture_detail_aqu.article_libelle,\n                          facture_detail_aqu.unite_numero,\n                          facture_detail_aqu.unite_code,\n                          facture_detail_aqu.unite_libelle,\n                          facture_detail_aqu.semestre_code,\n                          facture_detail_aqu.semestre_libelle,\n                          facture_detail_aqu.modalite_numero,\n                          facture_detail_aqu.modalite,\n                          facture_detail_aqu.auditeur_numero,\n                          facture_detail_aqu.auditeur_code,\n                          facture_detail_aqu.auditeur_nom,\n                          facture_detail_aqu.auditeur_prenom,\n                          facture_detail_aqu.auditeur_nom_usage,\n                          facture_detail_aqu.type_client,\n                          facture_detail_aqu.entreprise_numero,\n                          facture_detail_aqu.entreprise_nom,\n                          facture_detail_aqu.cra_nom,\n                          facture_detail_aqu.client_numero,\n                          facture_detail_aqu.client_nom,\n                          facture_detail_aqu.taux_tva,\n                          facture_detail_aqu.detail_fac_prix_unitaire,\n                          facture_detail_aqu.detail_fac_quantite,\n                          facture_detail_aqu.facture_montant_total,\n                          facture_detail_aqu.date_echeance,\n                          c.centre_code,\n                          c.centre_libelle,\n                          u.regroupement_programme_code,\n                          u.regroupement_programme_libelle\n                FROM      facture_detail_aqu\n                JOIN      inscription_aqu i\n                ON        i.centre_code     = facture_detail_aqu.centre_code\n                AND       i.auditeur_numero = facture_detail_aqu.auditeur_numero\n                AND       i.annee           = facture_detail_aqu.annee\n                JOIN      centre_aqu c\n                ON        c.centre_libelle = i.centre_attachement_libelle\n                LEFT JOIN unite_ouverte_aqu u\n                ON        u.semestre_code = facture_detail_aqu.semestre_code\n                AND       u.unite_numero  = facture_detail_aqu.unite_numero\n                AND       u.annee         = facture_detail_aqu.annee\n                AND       u.centre_code   = facture_detail_aqu.centre_code";
     if ($filtre->getSql()) {
         $sql .= ' WHERE ' . $filtre->getSql();
     }
     $dataRequest->setSql($sql);
     $em->setDataRequestAdapter($dataRequest);
     $result = $em->get('\\Zac2\\Domain\\' . ucfirst($entity), $filtre);
     $lignes = [];
     /** @var \Zac2\Domain\FactureDetail $row */
     foreach ($result as $row) {
         $lignes[$row->getAnnee() . $row->getCentreCode() . $row->getUniteNumero() . $row->getSemestreCode() . $row->getAuditeurCode()] = $row;
     }
     return $lignes;
 }