Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| ExchangeSlotscope | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb\Query; |
| 4 | |
| 5 | class ExchangeSlotscope extends Base |
| 6 | { |
| 7 | /** |
| 8 | * @var String TABLE mysql table reference |
| 9 | */ |
| 10 | const TABLE = 'slot_process'; |
| 11 | |
| 12 | const QUERY_READ_REPORT = ' |
| 13 | SELECT |
| 14 | `scopeID` as subjectid, |
| 15 | CONCAT(year, "-", LPAD(month, 2, 0), "-", LPAD(day, 2, 0)) as date, |
| 16 | SUM(slotcount), |
| 17 | SUM(intern) |
| 18 | FROM ( |
| 19 | SELECT s.*, COUNT(sp.slotID) as slotcount |
| 20 | FROM slot AS s |
| 21 | LEFT JOIN slot_process as sp USING(slotID) |
| 22 | WHERE s.`scopeID` = :scopeid AND status = "free" |
| 23 | GROUP BY s.slotID |
| 24 | ) AS innerquery |
| 25 | GROUP BY year, month, day |
| 26 | ORDER BY date ASC |
| 27 | '; |
| 28 | |
| 29 | const QUERY_SUBJECTS = ' |
| 30 | SELECT |
| 31 | scope.`StandortID` as subject, |
| 32 | MIN(CONCAT(year, "-", LPAD(month, 2, 0), "-", LPAD(day, 2, 0))) AS periodstart, |
| 33 | MAX(CONCAT(year, "-", LPAD(month, 2, 0), "-", LPAD(day, 2, 0))) AS periodend, |
| 34 | CONCAT(scope.`Bezeichnung`, " ", scope.`standortinfozeile`) AS description |
| 35 | FROM ' . Scope::TABLE . ' AS scope |
| 36 | LEFT JOIN slot AS s ON s.scopeID = scope.StandortID |
| 37 | LEFT JOIN slot_process AS sp USING(slotID) |
| 38 | WHERE sp.slotID IS NOT NULL |
| 39 | GROUP BY scope.`StandortID` |
| 40 | ORDER BY description ASC |
| 41 | '; |
| 42 | } |