(select om.department_id from order_manage om where om.order_user = cbr.customer_id and date_format(om.create_time, '%Y-%m-%d') = #{day} limit 1) department_id
(select om.department_id
from order_manage om
where om.order_user = cbr.customer_id
and date_format(om.create_time, '%Y-%m-%d') = #{day}
limit 1) department_id
from customer_balance_record cbr
from customer_balance_record cbr
left join order_manage om on om.order_user = cbr.customer_id and date_format(om.create_time, '%Y-%m-%d') = #{day}
left join order_manage om
on om.order_user = cbr.customer_id and date_format(om.create_time, '%Y-%m-%d') = #{day}