select
    baadr.role,
    baadr.agent_id,
    baadr.dialogs_id,
    baadr.member_id,
    baadr.content,
    baadr.image_url,
    baadr.`timestamp`,
    baap.agent_avatar,
    baap.agent_title
from
    biz_agent_application_dialogues_record baadr
left join biz_agent_application_publish baap on baadr.agent_id = baap.agent_id and baap.is_deleted = 'N'
where baadr.is_deleted = 'N'
<<and baadr.dialogs_id = :dialogueId>>
order by  baadr.`timestamp` asc