SELECT
bo.order_sn,
bo.total_amount,
bo.need_pay_amount,
bo.paid_amount,
bo.order_type,
bo.member_id,
bo.currency,
bo.order_status,
bo.pay_status,
bo.pay_time,
bo.cancel_time,
bo.CREATED_TIME,
bod.relation_type,
bod.relation_id,
bod.relation_name,
bmi.nick_name,
bmi.mobile_phone,
dm.merchant_name
FROM
biz_order AS bo
LEFT JOIN biz_order_detail AS bod ON bo.order_id = bod.order_id
LEFT JOIN biz_member_info  AS bmi ON bmi.member_id = bo.member_id
LEFT JOIN dgtools_merchant AS dm ON dm.merchant_id = bo.merchant_id
where bod.is_deleted = bo.is_deleted
<< and bo.order_sn li IKE CONCAT('%', :orderSn,'%')>>
<< and bod.relation_type = :relationType >>
<< and bod.relation_id = :relationId >>
<< and bod.is_deleted = :isDeleted >>
<< and bo.created_time <= :queryEndTime >>
<< and bo.created_time >= :queryBeginTime >>