Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| ExchangeWaitingdepartment | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb\Query; |
| 4 | |
| 5 | class ExchangeWaitingdepartment extends Base |
| 6 | { |
| 7 | /** |
| 8 | * @var String TABLE mysql table reference |
| 9 | */ |
| 10 | const TABLE = 'wartenrstatistik'; |
| 11 | |
| 12 | const QUERY_READ_DAY = ' |
| 13 | SELECT |
| 14 | w.`datum`, |
| 15 | ' . ExchangeWaitingscope::WAITING_VALUES . ' |
| 16 | FROM ' . self::TABLE . ' as w |
| 17 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 18 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 19 | WHERE |
| 20 | d.`BehoerdenID` = :departmentid |
| 21 | AND w.`datum` BETWEEN :datestart AND :dateend |
| 22 | GROUP BY w.`datum` |
| 23 | ORDER BY w.`datum` ASC |
| 24 | '; |
| 25 | |
| 26 | //PLEASE REMEMBER THE REALY COOL DYNAMIC VERSION |
| 27 | const QUERY_READ_MONTH = ' |
| 28 | SELECT |
| 29 | DATE_FORMAT(w.`datum`, "%Y-%m") as datum, |
| 30 | ' . ExchangeWaitingscope::WAITING_VALUES . ' |
| 31 | FROM ' . self::TABLE . ' as w |
| 32 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 33 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 34 | WHERE |
| 35 | d.`BehoerdenID` = :departmentid AND |
| 36 | w.`datum` BETWEEN :datestart AND :dateend |
| 37 | GROUP BY DATE_FORMAT(w.`datum`, "%Y-%m") |
| 38 | ORDER BY DATE_FORMAT(w.`datum`, "%Y-%m") ASC |
| 39 | '; |
| 40 | |
| 41 | const QUERY_READ_QUARTER = ' |
| 42 | SELECT |
| 43 | CONCAT(YEAR(w.`datum`),"-",QUARTER(w.`datum`)) as datum, |
| 44 | ' . ExchangeWaitingscope::WAITING_VALUES . ' |
| 45 | FROM ' . self::TABLE . ' as w |
| 46 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 47 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 48 | WHERE |
| 49 | d.`BehoerdenID` = :departmentid AND |
| 50 | w.`datum` BETWEEN :datestart AND :dateend |
| 51 | GROUP BY CONCAT(YEAR(w.`datum`),"-",QUARTER(w.`datum`)) |
| 52 | ORDER BY CONCAT(YEAR(w.`datum`),"-",QUARTER(w.`datum`)) ASC |
| 53 | '; |
| 54 | |
| 55 | const QUERY_SUBJECTS = ' |
| 56 | SELECT |
| 57 | s.`behoerdenid` as subject, |
| 58 | MIN(`datum`) AS periodstart, |
| 59 | MAX(`datum`) AS periodend, |
| 60 | o.`Organisationsname` AS organisationname, |
| 61 | d.`Name` AS description |
| 62 | FROM ' . self::TABLE . ' AS w |
| 63 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 64 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 65 | LEFT JOIN ' . Organisation::TABLE . ' AS o ON d.`OrganisationsID` = o.`OrganisationsID` |
| 66 | GROUP BY d.`BehoerdenID` |
| 67 | ORDER BY d.`BehoerdenID` ASC, periodstart DESC |
| 68 | '; |
| 69 | |
| 70 | const QUERY_PERIODLIST_DAY = ' |
| 71 | SELECT |
| 72 | `datum` |
| 73 | FROM ' . self::TABLE . ' AS w |
| 74 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 75 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 76 | WHERE |
| 77 | d.`BehoerdenID` = :departmentid |
| 78 | ORDER BY `datum` ASC |
| 79 | '; |
| 80 | |
| 81 | const QUERY_PERIODLIST_MONTH = ' |
| 82 | SELECT DISTINCT |
| 83 | DATE_FORMAT(`datum`,"%Y-%m") AS date |
| 84 | FROM ' . self::TABLE . ' AS w |
| 85 | LEFT JOIN ' . Scope::TABLE . ' AS s ON w.`standortid` = s.`StandortID` |
| 86 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` |
| 87 | WHERE |
| 88 | d.`BehoerdenID` = :departmentid |
| 89 | ORDER BY `datum` ASC |
| 90 | '; |
| 91 | } |