LEFT JOIN plm_routing_component as b on a.site = b.site and a.part_no = b.part_no and a.routing_revision = b.routing_revision and a.routing_type = b.routing_type and a.alternative_no = b.alternative_no and a.operation_id = b.operation_id
LEFT JOIN plm_routing_component as b on a.site = b.site and a.part_no = b.part_no and a.routing_revision = b.routing_revision and a.routing_type = b.routing_type and a.alternative_no = b.alternative_no and a.operation_id = b.operation_id
left join part as p on a.site = p.site and a.part_no = p.part_no
<where>
<where>
a.site = #{query.site}
a.site = #{query.site}
AND NOT (p.status = 'Y' AND (p.plm_part_no IS NULL OR p.plm_part_no = ''))
<iftest ="query.partNo != null and query.partNo != ''">
<iftest ="query.partNo != null and query.partNo != ''">