dbo.qc_get_supplier_name(qt.site, qat.manufacturer_id) as manufacturerName,
vs.supplierName as manufacturerName,
qat.resource_id,
qat.customer_id as customerID,
dbo.qc_get_customer_name(qt.site, qat.customer_id) as customerName
cu.CustomerName as customerName
FROM qc_attribute_template as qat
LEFT JOIN qc_template as qt ON qat.template_id = qt.template_id and qat.site = qt.site and qat.bu_no = qt.bu_no
LEFT JOIN qc_inspection_type AS qit ON qt.inspection_type_no = qit.inspection_type_no and qt.site = qit.site
WHERE qt.site = #{site} AND qat.attribute_no = #{attributeNo} and qt.bu_no = #{buNo}
left join view_Supplier as vs on qat.site = vs.site and qat.manufacturer_id = vs.SupplierID
left join Customer as cu on qat.site = cu.site and qat.customer_id = cu.CustomerID
WHERE qat.site = #{site} AND qat.attribute_no = #{attributeNo} and qat.bu_no = #{buNo}
</select>
<!-- 物料可选模板 -->
@ -1297,16 +1299,18 @@
qat.inspection_cycle,
qat.operation,
qat.manufacturer_id,
dbo.qc_get_supplier_name(qat.site, qat.manufacturer_id) as manufacturerName,
vs.supplierName as manufacturerName,
qat.resource_id,
qat.customer_id as customerID,
dbo.qc_get_customer_name(qt.site, qat.customer_id) as customerName
cu.CustomerName as customerName
FROM qc_attribute_template as qat
LEFT JOIN qc_part_attribute as qpa ON qpa.attribute_no = qat.attribute_no and qat.site = qpa.site and qat.bu_no = qpa.bu_no
LEFT JOIN qc_template as qt ON qat.template_id = qt.template_id and qat.site = qt.site and qat.bu_no = qt.bu_no
LEFT JOIN qc_sampling_inspection_level as qsil ON qat.sampling_level_no = qsil.sampling_level_no and qat.site = qsil.site and qat.bu_no = qsil.bu_no
LEFT JOIN qc_inspection_type as qit ON qt.inspection_type_no = qit.inspection_type_no and qt.site = qit.site
LEFT JOIN qc_sampling_inspection_programme as qsip ON qat.sampling_programme_no = qsip.sampling_programme_no and qat.site = qsip.site and qat.bu_no = qsip.bu_no
LEFT JOIN qc_part_attribute as qpa ON qpa.attribute_no = qat.attribute_no and qat.site = qpa.site and qat.bu_no = qpa.bu_no
LEFT JOIN qc_template as qt ON qat.template_id = qt.template_id and qat.site = qt.site and qat.bu_no = qt.bu_no
LEFT JOIN qc_sampling_inspection_level as qsil ON qat.sampling_level_no = qsil.sampling_level_no and qat.site = qsil.site and qat.bu_no = qsil.bu_no
LEFT JOIN qc_inspection_type as qit ON qt.inspection_type_no = qit.inspection_type_no and qt.site = qit.site
LEFT JOIN qc_sampling_inspection_programme as qsip ON qat.sampling_programme_no = qsip.sampling_programme_no and qat.site = qsip.site and qat.bu_no = qsip.bu_no
left join view_Supplier as vs on qat.site = vs.site and qat.manufacturer_id = vs.SupplierID
left join Customer as cu on qat.site = cu.site and qat.customer_id = cu.CustomerID
WHERE qat.site = #{site} and qpa.attribute_type = #{attributeType} and qpa.attribute_no = #{attributeNo} and qat.bu_no = #{buNo}