select  b.campaign_code campaignCode,
        b.campaign_name campaignName,
        c.user_name userName,
        a.phone_number phoneNumber,
        d.name customerName,
        to_date(a.start_call, 'DD/MM/YYYY') startCall,
        e.complete_name contactStatus,
        f.complete_name surveyStatus,
        g.status status,
        a.status recordStatus,
        (a.end_time - a.start_call)*24*60 callTime
from contact_cust_result a
    left join campaign b on a.campaign_id = b.campaign_id
    left join vsa_users c on a.agent_id = c.user_id
    left join customer d on a.customer_id = d.customer_id
    left join campaign_complete_code e on a.contact_status = e.complete_value
    left join campaign_complete_code f on a.call_status = e.complete_value
    left join campaign g on a.campaign_id = g.campaign_id
where a.status <> 0
    and a.company_site_id = :p_company_site_id
    and a.create_time >= to_date(:p_date_from, 'DD/MM/YYYY')
    and a.create_time <= to_date(:p_date_to, 'DD/MM/YYYY')
    and a.duration_call >= :p_call_time_from
    and a.duration_call <= :p_call_time_to
