Filter: ((NOT is_deleted) AND (ca_updated.property_id = property_id) AND CASE WHEN (event_type_id = ANY ('{3,7,10,395}'::integer[])) THEN ((event_datetime >= '2018-01-01 00:00:00-07'::timestamp with time zone) AND (event_datetime <= '2018-12-31 23:59:59-07'::timestamp with time zone)) WHEN (event_type_id = ANY ('{2,4}'::integer[])) THEN ((event_datetime >= '2018-01-01 00:00:00-07'::timestamp with time zone) AND (event_datetime <= '2019-01-01 23:59:59'::timestamp without time zone)) WHEN (event_type_id = ANY ('{9,17,78,13,131,12}'::integer[])) THEN true ELSE false END AND CASE WHEN (event_type_id = 2) THEN (util_to_bool((details ->> 'is_system_generated'::text)) IS DISTINCT FROM true) ELSE true END)