LEFT JOIN so_routing as c ON a.site = c.site and c.order_no = a.orderno and a.itemno = c.item_no
LEFT JOIN so_routing as c ON a.site = c.site and c.order_no = a.orderno and a.itemno = c.item_no
LEFT JOIN part j ON a.site = j.site and a.part_no = j.part_no
LEFT JOIN part as j ON a.site = j.site and a.part_no = j.part_no
LEFT JOIN qc_attribute_template as qat on j.site = qat.site and j.sourceBu = qat.bu_no and j.part_no = qat.attribute_no and qat.inspection_type_no = #{inspectionTypeNo}
LEFT JOIN qc_attribute_template as qat on j.site = qat.site and j.sourceBu = qat.bu_no and j.part_no = qat.attribute_no and qat.inspection_type_no = #{inspectionTypeNo}
LEFT JOIN qc_template as qt on qat.site = qt.site and qat.bu_no = qt.bu_no and qat.template_id = qt.template_id
LEFT JOIN qc_template as qt on qat.site = qt.site and qat.bu_no = qt.bu_no and qat.template_id = qt.template_id