Lines
n/a
0 / 0
Functions and Methods
n/a
0 / 0
Classes and Traits
n/a
0 / 0
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ExchangeSlotscope | n/a | 0 / 0 | n/a | 0 / 0 | 0 | n/a | 0 / 0 | |||
| 1 | <?php | |
| 2 | ||
| 3 | namespace BO\Zmsbackend\Exchange\Repository; | |
| 4 | ||
| 5 | class ExchangeSlotscope extends \BO\Zmsbackend\Query\Base | |
| 6 | { | |
| 7 | /** | |
| 8 | * @var String TABLE mysql table reference | |
| 9 | */ | |
| 10 | const string TABLE = 'slot_process'; | |
| 11 | ||
| 12 | const string 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 ' . \BO\Zmsbackend\Query\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 | } |