Browse Source

20241030

java8
qiezi 1 year ago
parent
commit
536220793c
  1. 29
      src/main/resources/mapper/quote/QuoteDetailMapper.xml

29
src/main/resources/mapper/quote/QuoteDetailMapper.xml

@ -193,7 +193,7 @@
else '其他' end) as priority_level, else '其他' end) as priority_level,
dbo.get_requester_name(qd.site, rh.requester) as requesterName, dbo.get_requester_name(qd.site, rh.requester) as requesterName,
rh.remark as rfqRemark, rh.remark as rfqRemark,
rd.id as rfq_detail_id
rd.id as rfq_detail_id
from plm_quote_detail qd from plm_quote_detail qd
left join plm_quote q on qd.quote_id = q.id left join plm_quote q on qd.quote_id = q.id
left join plm_customer_information c on q.customer_no = c.customer_no and q.site = c.site left join plm_customer_information c on q.customer_no = c.customer_no and q.site = c.site
@ -201,7 +201,7 @@
left join part pp on qd.part_id = pp.id left join part pp on qd.part_id = pp.id
left join plm_rfq_header rh left join plm_rfq_header rh
on rh.site = qd.site and rh.bu_no = qd.bu_no and qd.internal_inquiry_no = rh.rfq_no on rh.site = qd.site and rh.bu_no = qd.bu_no and qd.internal_inquiry_no = rh.rfq_no
left join plm_rfq_detail rd on rh.id = rd.rfq_id and rd.site = qd.site and rd.test_part_id = qd.part_id
left join plm_rfq_detail rd on rh.id = rd.rfq_id and rd.site = qd.site and rd.test_part_id = qd.part_id
<where> <where>
<if test="params.buId != null"> <if test="params.buId != null">
and b.id = #{params.buId} and b.id = #{params.buId}
@ -226,15 +226,26 @@
</if> </if>
<if test="params.list != null and params.list.size() > 0"> <if test="params.list != null and params.list.size() > 0">
and pp.part_no in (
select distinct p.part_no from part p
left join part_sub_properties_value_header ph on p.part_no = ph.part_no and p.site = ph.site and p.sourceBu = ph.bu_no and p.code_no = ph.code_no and ph.record_type = 'IP'
left join part_sub_properties_value pd on ph.part_no = pd.part_no and pd.site = ph.site and pd.bu_no = ph.bu_no and pd.code_no = ph.code_no and ph.record_type = pd.record_type
left join BU b on p.sourceBu = b.bu_no and p.site = b.site
where b.id = #{params.buId} and p.code_no = #{params.codeNo}
and pp.part_no in (SELECT distinct p.part_no
FROM part p
LEFT JOIN BU b ON p.sourceBu = b.bu_no AND p.site = b.site
INNER JOIN part_sub_properties_value_header ph
ON p.part_no = ph.part_no AND p.site = ph.site AND
p.sourceBu = ph.bu_no
AND p.code_no = ph.code_no AND ph.record_type = 'IP'
WHERE b.id = 1018
AND p.code_no = 'M01'
<foreach collection="params.list" item="item"> <foreach collection="params.list" item="item">
AND EXISTS (
SELECT 1
FROM part_sub_properties_value pd
WHERE pd.part_no = p.part_no
AND pd.site = p.site
AND pd.bu_no = p.sourceBu
AND pd.code_no = p.code_no
AND pd.record_type = 'IP'
<if test="item.propertiesItemNo != null and item.propertiesItemNo != ''"> <if test="item.propertiesItemNo != null and item.propertiesItemNo != ''">
and (pd.properties_item_no = #{item.propertiesItemNo}
and pd.properties_item_no = #{item.propertiesItemNo}
</if> </if>
<if test="item.textValue != null and item.textValue != ''"> <if test="item.textValue != null and item.textValue != ''">
and pd.text_value = #{item.textValue} and pd.text_value = #{item.textValue}

Loading…
Cancel
Save