Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
ExchangeNotificationscope
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace BO\Zmsdb\Query;
4
5class ExchangeNotificationscope 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          s.`StandortID` 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 ' . self::TABLE . ' AS n
21          LEFT JOIN ' . Scope::TABLE . ' s ON n.StandortID = s.StandortID
22          LEFT JOIN ' . Department::TABLE . ' d ON d.BehoerdenID = s.BehoerdenID
23          LEFT JOIN ' . Organisation::TABLE . ' o ON o.OrganisationsID = d.OrganisationsID
24      WHERE n.`StandortID` = :scopeid AND n.`Datum` BETWEEN :datestart AND :dateend
25      GROUP BY subjectid
26    ';
27
28    const QUERY_SUBJECTS = '
29        SELECT
30            s.`StandortID` as subject,
31            MIN(n.`Datum`) AS periodstart,
32            MAX(n.`Datum`) AS periodend,
33            s.`Bezeichnung` AS description
34        FROM ' . self::TABLE . ' AS n
35            INNER JOIN ' . Scope::TABLE . ' AS s ON n.`standortid` = s.`StandortID`
36        GROUP BY s.`StandortID`
37        ORDER BY s.`StandortID` ASC
38    ';
39
40    const QUERY_PERIODLIST_MONTH = '
41        SELECT
42            DATE_FORMAT(n.datum,"%Y-%m") AS date
43        FROM ' . self::TABLE . ' AS n
44        WHERE n.`StandortID` = :scopeid
45        GROUP BY date
46        ORDER BY date ASC
47    ';
48}