public.vwrealtimeuser_groups

public.vwrealtimeuser_groups

Description

Table Definition

CREATE VIEW vwrealtimeuser_groups AS (
 SELECT rd.name AS user_name,
    rd.id AS user_id,
    rd.divisionid,
    rd.division_name,
    rd.groupid,
    rd.groupname,
    rd.managername,
    rd.managerid,
        CASE
            WHEN (rd.systempresence = 'ON_QUEUE'::text) THEN (rd.routingstatus)::text
            ELSE upper(replace(rd.orgpresence, 'On Queue'::text, 'ON_QUEUE'::text))
        END AS agentstatus,
        CASE
            WHEN (rd.systempresence = 'ON_QUEUE'::text) THEN rd.routstattime
            ELSE rd.presencetime
        END AS agenttime,
        CASE
            WHEN (rd.systempresence = 'ON_QUEUE'::text) THEN ((rd.routstattime)::double precision * '00:00:01'::interval)
            ELSE ((rd.presencetime)::double precision * '00:00:01'::interval)
        END AS agenttime_formatted,
    ((
        CASE
            WHEN (rd.systempresence = 'ON_QUEUE'::text) THEN rd.routstattime
            ELSE rd.presencetime
        END)::numeric / 86400.00) AS agenttimeday,
    rd.systempresence,
    rd.orgpresence,
    rd.routingstatus,
    rd.routstarttime,
    rd.routstattime,
    rd.routstattimeday,
    rd.presenceid,
    rd.presstarttime,
    rd.presencetime,
    rd.presencetimeday,
    rd.queuename,
    rd.conversationid,
    rd.media,
    rd.direction,
    rd.acwstate,
    rd.acwtime,
    rd.adherencestate,
    rd.adherencestarttime,
    rd.impact,
    rd.scheduledactivitycategory
   FROM ( SELECT rl.id,
            rl.name,
            gd.id AS groupid,
            gd.name AS groupname,
            ud.managerid,
            ud.managername,
            ud.divisionid,
            dd.name AS division_name,
            upper(replace((rl.systempresence)::text, 'On Queue'::text, 'ON_QUEUE'::text)) AS systempresence,
            upper(replace((pr.orgpresence)::text, 'On Queue'::text, 'ON_QUEUE'::text)) AS orgpresence,
                CASE
                    WHEN (((rl.routingstatus)::text = 'IDLE'::text) AND (((((rl.cccallactive + rl.othcallactive) + rl.cbcallactive) + rl.cbothcallactive) + rl.ccemailactive) > 0)) THEN 'ALERT'::character varying
                    ELSE rl.routingstatus
                END AS routingstatus,
            rl.routstarttime,
            datediff('second'::character varying, rl.routstarttime, now_utc()) AS routstattime,
            ((datediff('second'::character varying, rl.routstarttime, now_utc()))::numeric / 86400.00) AS routstattimeday,
            rl.presenceid,
            rl.presstarttime,
            datediff('second'::character varying, rl.presstarttime, now_utc()) AS presencetime,
            ((datediff('second'::character varying, rl.presstarttime, now_utc()))::numeric / 86400.00) AS presencetimeday,
            qd.name AS queuename,
            qd.id AS queueid,
            uc.conversationid,
            uc.media,
            uc.direction,
            uc.conversationstate,
            uc.acwstate,
            datediff('second'::character varying, uc.acwtime, now_utc()) AS acwtime,
            rl.adherencestate,
            rl.adherencestarttime,
            rl.impact,
            rl.scheduledactivitycategory
           FROM (((((((userrealtimedata rl
             LEFT JOIN presencedetails pr ON (((pr.id)::text = (rl.presenceid)::text)))
             LEFT JOIN userrealtimeconvdata uc ON (((uc.userid)::text = (rl.id)::text)))
             LEFT JOIN queuedetails qd ON (((qd.id)::text = (uc.queueid)::text)))
             LEFT JOIN vwuserdetail ud ON (((ud.id)::text = (rl.id)::text)))
             LEFT JOIN usergroupmappings ug ON (((ug.userid)::text = (rl.id)::text)))
             LEFT JOIN groupdetails gd ON (((gd.id)::text = (ug.groupid)::text)))
             LEFT JOIN divisiondetails dd ON (((dd.id)::text = (ud.divisionid)::text)))) rd
)

Columns

Name Type Default Nullable Children Parents Comment
user_name varchar(255) true
user_id varchar(50) true
divisionid varchar(50) true
division_name varchar(50) true
groupid varchar(50) true
groupname varchar(255) true
managername varchar(200) true
managerid varchar(50) true
agentstatus text true
agenttime integer true
agenttime_formatted interval true
agenttimeday numeric true
systempresence text true
orgpresence text true
routingstatus varchar true
routstarttime timestamp without time zone true
routstattime integer true
routstattimeday numeric true
presenceid varchar(50) true
presstarttime timestamp without time zone true
presencetime integer true
presencetimeday numeric true
queuename varchar(255) true
conversationid varchar(50) true
media varchar(50) true
direction varchar(50) true
acwstate boolean true
acwtime integer true
adherencestate varchar(50) true
adherencestarttime timestamp without time zone true
impact varchar(50) true
scheduledactivitycategory varchar(50) true

Referenced Tables

Name Columns Comment Type
public.userrealtimedata 34 BASE TABLE
public.presencedetails 7 Persence Code Lookup Data BASE TABLE
public.userrealtimeconvdata 32 User Real Time Conversation Data BASE TABLE
public.queuedetails 17 Queue Lookup data BASE TABLE
public.vwuserdetail 17 See UserDetail: User Description in detail VIEW
public.usergroupmappings 5 BASE TABLE
public.groupdetails 8 Agent Group Lookup Data BASE TABLE
public.divisiondetails 4 BASE TABLE

    • Related Articles

    • public.vwrealtimeuser

      Description Real-time user data Table Definition CREATE VIEW vwrealtimeuser AS ( SELECT rd.name AS user_name, rd.id AS user_id, rd.divisionid, rd.groupname, rd.managername, rd.managerid, CASE WHEN (rd.systempresence = 'ON_QUEUE'::text) THEN ...
    • public.vwrealtimeuserconv

      Description Real-time user conversation data Table Definition CREATE VIEW vwrealtimeuserconv AS ( SELECT ud.conversationid, ud.media, ud.queueid, ud.direction, ud.conversationstate, CASE WHEN ((ud.conversationstate)::text = 'dialing'::text) THEN ...
    • public.participantattributesdynamic

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false conversationid varchar(50) false conversationstartdate timestamp without time zone false conversationstartdateltc timestamp without time zone true ...
    • public.evalquestiondata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false evaluationid varchar(50) false evaluationformid varchar(50) false questiongroupid varchar(50) true questionid varchar(50) true answerid varchar(50) true ...
    • public.userpresencedetaileddata

      Description User Presence Detailed Data Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false Primary Key userid varchar(50) true Agent GUID starttime timestamp without time zone false Start Time (UTC) starttimeltc ...