select t1.* from stock_order t1 left join io_order t2 on t1.billNo = t2.erpFk
<where>
<iftest="request.billNo != null and request.billNo != ''">
AND (t2.erpFk like concat('%', #{request.billNo}, '%') or t2.thirdBillNo like concat('%',#{request.billNo},'%') or t1.billNo like concat('%', #{request.billNo}, '%'))
AND (t2.erpFk like concat('%', #{request.billNo}, '%') or t2.thirdBillNo like concat('%',#{request.billNo},'%'))