Jal Table de référence : revue sql d'export CodeJournal

This commit is contained in:
Michael RICOIS 2015-12-04 15:31:03 +00:00
parent 89abfca252
commit d69fcc5d0f

View File

@ -45,10 +45,13 @@ $requests = array(
'REF_CodeJournal_' => array(
'header' => array('id', 'nomJALedition', 'parution', 'parutionJours', 'aboDateDeb', 'aboDateFin', 'priorite'),
'columns' => array('id', 'nomJALedition', 'parution', 'parutionJours', 'aboDateDeb', 'aboDateFin', 'priorite'),
'sql' => "SELECT jal.id, jal.nomJALedition, jal.parution, jal.parutionJours, abo.aboDateDeb, abo.aboDateFin,
IF(jalPrioritaire=1,'A',IF(parution='Q','C','B')) AS priorite
FROM jo.tabJALed AS jal LEFT JOIN jo.tabJALabo AS abo ON jal.id = abo.jalId
WHERE jal.dateSuppr=0",
'sql' => "SELECT jal.id, jal.nomJALedition, jal.parution, jal.parutionJours, jalabo.aboDateDeb, jalabo.aboDateFin,
IF(jal.jalPrioritaire=1,'A',IF(jal.parution='Q','C','B')) AS priorite
FROM jo.tabJALed AS jal
JOIN ( SELECT abo.jalId, abo.aboDateDeb, abo.aboDateFin FROM jo.tabJALabo AS abo
GROUP BY abo.jalId ORDER BY abo.aboDateFin DESC
) AS jalabo ON jalabo.jalId = jal.id
WHERE jal.dateSuppr=0 ORDER BY jal.id",
),
'REF_CodeFormeJuridique_' => array(
'header' => array('code', 'libelle', 'libelleCourt'),
@ -65,9 +68,16 @@ $requests = array(
'header' => array('triId', 'triCode', 'triType', 'triNom', 'triVille'),
'columns' => array('triId', 'triCode', 'triType', 'triNom', 'triVille'),
'sql' => "SELECT triId, triCode, triType, triNom, triVille
FROM jo.tribunaux
WHERE triType IN ('L', 'C', 'I', 'G', 'M');",
)
FROM jo.tribunaux
WHERE triType IN ('L', 'C', 'I', 'G', 'M');",
),
/*'REF_Evenements' => array(
'header' => array('triId', 'triCode', 'triType', 'triNom', 'triVille'),
'columns' => array('triId', 'triCode', 'triType', 'triNom', 'triVille'),
'sql' => "SELECT triId, triCode, triType, triNom, triVille
FROM jo.tribunaux
WHERE triType IN ('L', 'C', 'I', 'G', 'M');",
),*/
);
$dateBegin = date('YmdHis');