Add support for retriving incidents within set time period
This commit is contained in:
@@ -159,13 +159,14 @@ CREATE VIEW `incidentstatus_current` AS (
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for view `incidentstatus_open`
|
||||
-- Table structure for view `incident_open`
|
||||
--
|
||||
|
||||
DROP VIEW IF EXISTS `incident_open`;
|
||||
CREATE VIEW `incident_open` AS (
|
||||
SELECT
|
||||
`i`.*
|
||||
`i`.*,
|
||||
`isc`.`ctime`
|
||||
FROM
|
||||
`incident` AS `i`
|
||||
JOIN `incidentstatus_current` AS `isc`
|
||||
@@ -174,6 +175,35 @@ CREATE VIEW `incident_open` AS (
|
||||
`isc`.`status` IN (1,2,3,4)
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for view `incident_closedtime`
|
||||
--
|
||||
|
||||
DROP VIEW IF EXISTS `incident_closedtime`;
|
||||
CREATE VIEW `incident_closedtime` AS (
|
||||
SELECT
|
||||
`incident` AS `incident`,
|
||||
`ctime` AS `ctime`
|
||||
FROM
|
||||
`incidentstatus`
|
||||
WHERE
|
||||
`status` = 0
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for view `incident_opentimes`
|
||||
--
|
||||
|
||||
DROP VIEW IF EXISTS `incident_opentimes`;
|
||||
CREATE VIEW `incident_opentimes` AS (
|
||||
SELECT
|
||||
`i`.*,
|
||||
IFNULL(`t`.`ctime`, 0xffffffff+0) AS `ctime`
|
||||
FROM
|
||||
`incident` as `i`
|
||||
LEFT JOIN `incident_closedtime` AS `t` ON `i`.`id`=`t`.`incident`
|
||||
);
|
||||
|
||||
--
|
||||
-- Table structure for table `user`
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user