为空情况和不为空数据关联
select *
from mi_Cod_mall_order o
where 1 = 1
and ((o.source_type is not null) or
(o.source_type is null and exists
(select *
from mi_cod_mall_order ord
where ord.order_id is not null
and o.order_id = ord.order_id)))