dbo.qc_get_um_name(a.site, b.umid2) as printUnitName,
isnull(c.yield_rate, 100) as yieldRate
isnull(dbo.get_yield_rate(a.site, a.bu_no, b.product_group_id2, '2'), 100) as yieldRate
FROM plm_bom_header as a
left join part as b on a.site = b.site and a.bu_no = b.sourceBu and a.part_no = b.part_no
left join part_product_group as c on b.site = c.site and b.sourceBu = c.bu_no and b.product_group_id2 = c.product_group_id
left join plm_bom_detail as d on a.site = d.site and a.bu_no = d.bu_no and a.part_no = d.part_no and a.eng_chg_level = d.eng_chg_level and a.bom_type = d.bom_type
<where>
a.site in (select site from eam_access_site where username = #{query.userName})
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
and c.type = '2'
and d.alternative_no = '*'
<iftest="query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo}
</if>
@ -47,6 +47,9 @@
<iftest ="query.engChgLevel != null and query.engChgLevel != ''">
AND a.eng_chg_level = #{query.engChgLevel}
</if>
<iftest ="query.status != null and query.status != ''">
AND d.status = #{query.status}
</if>
</where>
</select>
@ -64,9 +67,8 @@
case when a.part_type2 = 'Manufactured' then '成品' when a.part_type2 = 'Manufactured Recipe' then '半成品' when a.part_type2 = 'Purchased (raw)' then '原材料' end as partType2Desc,
a.FamilyID,
dbo.get_family_name(a.site, a.sourceBu, a.FamilyID) as familyName,
isnull(b.yield_rate, 100) as yieldRate
isnull(dbo.get_yield_rate(a.site, a.sourceBu, a.product_group_id2, '2'), 100) as yieldRate
FROM part as a
left join part_product_group as b on a.site = b.site and a.sourceBu = b.bu_no and a.product_group_id2 = b.product_group_id and b.type = '2'
<where>
a.site = #{query.site} and a.sourceBu = #{query.buNo} and a.active = 'Y'
and (a.part_type2 <![CDATA[<>]]> 'Purchased (raw)' or a.part_type2 is null)
@ -93,9 +95,8 @@
case when a.part_type2 = 'Manufactured' then '成品' when a.part_type2 = 'Manufactured Recipe' then '半成品' when a.part_type2 = 'Purchased (raw)' then '原材料' end as partType2Desc,
a.FamilyID,
dbo.get_family_name(a.site, a.sourceBu, a.FamilyID) as familyName,
isnull(b.yield_rate, 100) as yieldRate
isnull(dbo.get_yield_rate(a.site, a.sourceBu, a.product_group_id2, '2'), 100) as yieldRate
FROM part as a
left join part_product_group as b on a.site = b.site and a.sourceBu = b.bu_no and a.product_group_id2 = b.product_group_id and b.type = '2'
<where>
a.site = #{query.site} and a.sourceBu = #{query.buNo} and a.active = 'Y'
and (a.part_type2 <![CDATA[<>]]> 'Purchased (raw)' or a.part_type2 is null)
@ -309,11 +310,10 @@
a.type_flag,
a.net_weight,
a.note_text,
isnull(c.yield_rate, 0) as yieldRate
isnull(dbo.get_yield_rate(b.site, b.sourceBu, b.product_group_id2, '2'), 100) as yieldRate
FROM plm_bom_header as a
left join part as b on a.site = b.site and a.bu_no = b.sourceBu and a.part_no = b.part_no
left join part_product_group as c on b.site = c.site and b.sourceBu = c.bu_no and b.product_group_id2 = c.product_group_id
where a.site = #{site} and a.bu_no = #{buNo} and a.part_no = #{partNo} and a.bom_type = #{bomType} and a.eng_chg_level = #{engChgLevel} and c.type = '2'
where a.site = #{site} and a.bu_no = #{buNo} and a.part_no = #{partNo} and a.bom_type = #{bomType} and a.eng_chg_level = #{engChgLevel}
</select>
<!-- bom明细查重 -->
@ -667,18 +667,16 @@
a.update_by,
b.umid2 as printUnit,
dbo.qc_get_um_name(a.site, b.umid2) as printUnitName,
isnull(c.yield_rate, 100) as yieldRate,
isnull(dbo.get_yield_rate(b.site, b.sourceBu, b.product_group_id2, '2'), 100) as yieldRate
#{alternativeNo} as alternativeNo
FROM plm_bom_header as a
left join part as b on a.site = b.site and a.bu_no = b.sourceBu and a.part_no = b.part_no
left join part_product_group as c on b.site = c.site and b.sourceBu = c.bu_no and b.product_group_id2 = c.product_group_id