SELECT
    ac.channel,
    COALESCE(COUNT(bdr.relation_id), 0) AS usage_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 YEAR(bdr.datetime) = YEAR(CURRENT_DATE) and MONTH(bdr.datetime) = MONTH(CURRENT_DATE)
    << AND relation_id = :relationId >>
where 1=1
    << AND ac.channel in (:channels) >>
GROUP BY
    ac.channel