Code Coverage  | 
      ||||||||||
Lines  | 
       Functions and Methods  | 
       Classes and Traits  | 
      ||||||||
| Total | n/a  | 
       0 / 0  | 
       n/a  | 
       0 / 0  | 
       CRAP | n/a  | 
       0 / 0  | 
      |||
| ExchangeNotificationorganisation | n/a  | 
       0 / 0  | 
       n/a  | 
       0 / 0  | 
       0 | n/a  | 
       0 / 0  | 
      |||
| 1 | <?php | 
| 2 | |
| 3 | namespace BO\Zmsdb\Query; | 
| 4 | |
| 5 | class ExchangeNotificationorganisation extends Base | 
| 6 | { | 
| 7 | /** | 
| 8 | * @var String TABLE mysql table reference | 
| 9 | */ | 
| 10 | const TABLE = 'abrechnung'; | 
| 11 | |
| 12 | const QUERY_READ_REPORT = ' | 
| 13 | SELECT | 
| 14 | o.`OrganisationsID` as subjectid, | 
| 15 | DATE_FORMAT(n.`Datum`, :groupby) as date, | 
| 16 | o.`Organisationsname` as organisationname, | 
| 17 | d.`Name` as departmentname, | 
| 18 | CONCAT(s.`Bezeichnung`, " ", s.`standortkuerzel`) AS scopename, | 
| 19 | IFNULL(SUM(n.`gesendet`), 0) as notificationscount | 
| 20 | FROM ' . Organisation::TABLE . ' AS o | 
| 21 | LEFT JOIN ' . Department::TABLE . ' d ON d.`OrganisationsID` = o.`OrganisationsID` | 
| 22 | LEFT JOIN ' . Scope::TABLE . ' s ON d.`BehoerdenID` = s.`BehoerdenID` | 
| 23 | LEFT JOIN ' . self::TABLE . ' n ON | 
| 24 | s.`StandortID` = n.`StandortID` AND | 
| 25 | n.`Datum` BETWEEN :datestart AND :dateend | 
| 26 | WHERE | 
| 27 | o.`OrganisationsID` = :organisationid | 
| 28 | GROUP BY d.`BehoerdenID` | 
| 29 | ORDER BY date, departmentname, scopename | 
| 30 | '; | 
| 31 | |
| 32 | const QUERY_SUBJECTS = ' | 
| 33 | SELECT | 
| 34 | o.`OrganisationsID` as subject, | 
| 35 | MIN(n.`Datum`) AS periodstart, | 
| 36 | MAX(n.`Datum`) AS periodend, | 
| 37 | o.`Organisationsname` AS description | 
| 38 | FROM ' . self::TABLE . ' AS n | 
| 39 | LEFT JOIN ' . Scope::TABLE . ' AS s ON n.`standortid` = s.`StandortID` | 
| 40 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` | 
| 41 | INNER JOIN ' . Organisation::TABLE . ' AS o ON d.`OrganisationsID` = o.`OrganisationsID` | 
| 42 | GROUP BY o.`OrganisationsID` | 
| 43 | ORDER BY o.`OrganisationsID` ASC | 
| 44 | '; | 
| 45 | |
| 46 | const QUERY_PERIODLIST_MONTH = ' | 
| 47 | SELECT | 
| 48 | DATE_FORMAT(n.datum,"%Y-%m") AS date | 
| 49 | FROM ' . self::TABLE . ' AS n | 
| 50 | LEFT JOIN ' . Scope::TABLE . ' AS s ON n.`standortid` = s.`StandortID` | 
| 51 | LEFT JOIN ' . Department::TABLE . ' AS d ON s.`BehoerdenID` = d.`BehoerdenID` | 
| 52 | INNER JOIN ' . Organisation::TABLE . ' AS o ON d.`OrganisationsID` = o.`OrganisationsID` | 
| 53 | WHERE o.`OrganisationsID` = :organisationid | 
| 54 | GROUP BY date | 
| 55 | ORDER BY date ASC | 
| 56 | '; | 
| 57 | } |