SELECT 
    E.event_time AS eventTime,
    E.event_time_zone AS eventTimezone,
    E.event_type AS eventType,
    E.shift_start AS shiftStart,
    P.system_id AS personSystemId,
    T.system_id AS taskSystemId
FROM
    eventlog E
        INNER JOIN
    person P ON E.person_id = P.person_id
        INNER JOIN
    user_group_membership UGM ON P.person_id = UGM."member"
        AND UGM.assigned_group_id = :usergroupparam
        LEFT JOIN
    task T ON E.task_id = T.task_id
WHERE
    P.customer_id = :customerparam
        AND E.modified_at > TO_DATE(:updateafterparam,'yyyy-mm-dd hh24:mi:ss')
        AND E.is_deleted != 0
        AND (E.event_type IS NULL OR E.event_type = 1)
