1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| (SELECT tr.category, LEFT(cat.name,4) AS categorie,
'assign' AS status_assign , count(case tr.STATUS when 'assign' then tr.id end) AS 'en cours (attribué)',
'waiting' AS status_waiting, count(case tr.STATUS when 'waiting' then tr.id end) AS nb_waiting,
'plan' AS status_plan , count(case tr.STATUS when 'plan' then tr.id end) AS nb_plan
FROM glpi.glpi_tracking tr
INNER JOIN glpi.glpi_dropdown_tracking_category cat
ON (tr.category = cat.ID)
WHERE (tr.STATUS IN ('assign', 'waiting','plan'))
and cat.name!='eCap - Habilitation / accès'
AND (LEFT(cat.name,4)='eCap' OR LEFT(cat.name,4)='DXC ')
GROUP BY LEFT(cat.name,4) )
UNION
(SELECT tr.category, cat.name AS categorie,
'assign' AS status_assign , count(case tr.STATUS when 'assign' then tr.id end) AS 'en cours (attribué)',
'waiting' AS status_waiting, count(case tr.STATUS when 'waiting' then tr.id end) AS nb_waiting,
'plan' AS status_plan , count(case tr.STATUS when 'plan' then tr.id end) AS nb_plan
FROM glpi.glpi_tracking tr
INNER JOIN glpi.glpi_dropdown_tracking_category cat
ON (tr.category = cat.ID)
WHERE (tr.STATUS IN ('assign', 'waiting','plan'))
AND (LEFT(cat.name,4)='MAT ' OR cat.name ='PC - Poste PC std / portable' OR cat.name ='IMP - Imprimante locale / réseau')
) |
Partager