maya
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ot_ro_getuseralertcount(integer)
Parameters
Name
Type
Mode
idmayauser
integer
IN
totalalerts
bigint
OUT
totalnotificaciones
bigint
OUT
totalmaintenance
bigint
OUT
Definition
SELECT coalesce(sum(totalalerts),0)::bigint totalalerts ,coalesce(sum(totalnotificaciones),0)::bigint totalnotificaciones,coalesce(sum(totalmaintenance),0)::bigint totalmaintenance FROM mvw_mayauser_device u JOIN mvw_device_alert da ON da.iddevice = u.iddevice JOIN mayauser mu ON mu.idmayauser = u.idmayauser WHERE u.idmayauser = $1 AND mu.idclient = da.idclient limit 1;