LEFT JOIN qc_template_detailed b ON b.template_id = #{templateId} and b.ItemNo = a.ItemNo and a.site = b.site and a.bu_no = b.bu_no
WHERE a.ItemType = #{itemType} and a.site = #{site} and b.template_id is null and a.bu_no = #{buNo}
WHERE a.ItemType = #{itemType} and a.site = #{site} and b.template_id is null and a.bu_no = #{buNo} and dbo.qc_get_inspection_type_name(a.site, a.inspection_type_no) = #{inspectionTypeName}
</select>
<!-- 查询项目 -->
@ -540,7 +540,7 @@
FROM eam_properties_item a
LEFT JOIN qc_template_detailed b ON b.template_id = #{templateId} and b.ItemNo = a.ItemNo and a.site = b.site and a.bu_no = b.bu_no
<where>
a.ItemType = #{itemType} and a.site = #{site} and b.template_id is null and a.bu_no = #{buNo}
a.ItemType = #{itemType} and a.site = #{site} and b.template_id is null and a.bu_no = #{buNo} and dbo.qc_get_inspection_type_name(a.site, a.inspection_type_no) = #{inspectionTypeName}
<iftest ="itemNo != null and itemNo != ''">
AND a.ItemNo LIKE '%' + #{itemNo} + '%'
</if>
@ -2864,7 +2864,7 @@
dbo.qc_get_inspection_type_name(site, inspection_type_no) as inspectionTypeName
FROM qc_template
<where>
site = #{site} and bu_no = #{buNo}
site = #{site} and bu_no = #{buNo} and dbo.qc_get_inspection_type_name(site, inspection_type_no) = #{inspectionTypeName}
<iftest ="templateId != null and templateId != ''">