status='EAVIS' and ((DEST_USER = @user) OR (DEST_USER IN (select user_id from users_entities WHERE entity_id IN( @my_entities)) or DESTINATION in (@subentities[@my_entities]))) and res_id IN (SELECT res_id FROM listinstance WHERE item_mode = 'avis' and difflist_type = 'entity_id' and process_date is not NULL and res_view_letterbox.res_id = res_id group by res_id)