and o.mer_id = #{merId}
and o.order_no = #{orderNo}
and o.create_time >= #{startTime}
and o.create_time #{endTime}
and INSTR(p.name, #{productName})
and INSTR(o.member_name, #{memberName})
and o.pay_type = #{payType}
and o.type = #{type}
and o.insurance_type = #{insuranceType}
and o.user_name = #{userName}
and p.category_id = #{categoryId}
and o.paid = 0
and o.status = 0
and o.cancel_status = 0
and o.is_user_del = 0
and o.status in (1,2)
and o.cancel_status = 0
and o.refund_status != 3
and o.is_user_del = 0
-- 已发货/待收货
and o.status = 4
and o.cancel_status = 0
and o.refund_status != 3
and o.is_user_del = 0
-- 待核销
and o.status = 3
and o.cancel_status = 0
and o.refund_status != 3
and o.is_user_del = 0
-- 已收货
and o.`status` = 5
and o.cancel_status = 0
and o.refund_status != 3
and o.is_user_del = 0
and o.status = 6
and o.cancel_status = 0
and o.refund_status != 3
and o.is_user_del = 0
and o.paid = 1
and o.cancel_status = 0
and o.refund_status = 3
and o.is_user_del = 0
and o.is_user_del = 1
and o.cancel_status = 1
and o.is_del = 0
from eb_order o
left join eb_order_detail detail on o.order_no = detail.order_no
left join eb_product p on detail.product_id = p.id
left join eb_merchant m on o.mer_id = m.id
left join eb_user u on o.uid = u.id
left join eb_merchant_order mo on o.order_no = mo.order_no
left join bcx_pay_offline bpo on o.order_no = bpo.order_no