join trans_detail_sub b on a.trans_no = b.trans_no and a.site = b.site
left join handling_unit c on b.sub_no = c.unit_id and b.site = c.site
where b.part_no = #{request.partNo} and a.order_ref1 = #{request.orderNo} and a.site = #{request.site} and c.unit_id is not null
where b.part_no = #{request.partNo} and b.batch_no = #{request.batchNo} and a.order_ref1 = #{request.orderNo} and a.site = #{request.site} and c.unit_id is not null