maya
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ot_ro_fast_event(integer, timestamp with time zone, timestamp with time zone)
Parameters
Name
Type
Mode
_iddevice
integer
IN
_startdate
timestamp with time zone
IN
_enddate
timestamp with time zone
IN
Definition
/* v20180423 To provide the Integrated Monitor with a list from events in a fast way */ DECLARE _adjusted_enddate timestamptz := _enddate + '50 seconds'::interval; -- there is an issue with the app in which it passes a lagged timestampt, and the most recent event aren't shown, this is a temporary workaround BEGIN RETURN QUERY (SELECT * FROM public.event WHERE iddevice = _iddevice AND senddate BETWEEN _startdate::timestamptz AND _adjusted_enddate AND (eventcat = 2 or eventcat is null)); END;