SELECT 
    E.event_id AS eventId,
    E.event_time AS eventTime,
    E.latitude AS eventLatitude,
    E.longitude AS eventLongitude,
    E.address AS eventAddress,
    E.description AS eventDescription,
    E.shift_start AS shiftStart,
    E.shift_span_seconds AS shiftSpanSeconds,
    E.work_hours AS workHours,
    E.is_ot_enabled AS isOtEnabled,
    E.ot_start AS otStart,
    E.ot_span_seconds AS otSpanSeconds,
    E.is_limitot AS isLimitOT,
    E.maxot AS maxOT,
    E.person_id,
    E.task_id,
    P.system_id AS personSystemId,
    P.employee_code AS employeeCode,
    T.system_id AS taskSystemId,
    T.name AS taskName
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.event_time > TO_DATE(:updateafterparam,'yyyy-mm-dd hh24:mi:ss')
        AND E.is_deleted = 0