SELECT
    ac.channel,
    COALESCE(COUNT(DISTINCT bdr.member_id), 0) AS member_count
FROM
    (SELECT 'index' AS channel UNION ALL
     SELECT 'mall' UNION ALL
     SELECT 'link_share' UNION ALL
     SELECT 'api' UNION ALL
     SELECT 'preview' UNION ALL
     SELECT 'multi_preview') AS ac
LEFT JOIN biz_data_analyze_dialogue_record bdr
    ON ac.channel = bdr.channel 
    << AND datetime >=  :startDate AND datetime <= :endDate >>
    << AND relation_id = :relationId >>
where 1=1
    << AND ac.channel in (:channels) >>
GROUP BY
    ac.channel