新增按套餐版本查询销售附加费关联,优化产品附加费展示逻辑
This commit is contained in:
@@ -71,19 +71,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
bp.fv_registration_fee as base_registration_fee,
|
||||
d.discount_value, d.round_mode, d.pr_id, d.effective_date, d.expire_date, d.is_del, d.create_time, d.update_time
|
||||
from prc_price_set_detail d
|
||||
left join prc_price_set_detail bp
|
||||
on bp.price_type = 'PRODUCT'
|
||||
and bp.product_code = d.product_code
|
||||
and ifnull(bp.country_code,'') = ifnull(d.country_code,'')
|
||||
and ifnull(bp.zone_code,'') = ifnull(d.zone_code,'')
|
||||
and ifnull(bp.weight_min,-1) = ifnull(d.weight_min,-1)
|
||||
and ifnull(bp.weight_max,-1) = ifnull(d.weight_max,-1)
|
||||
and ifnull(bp.is_del, '0') = '0'
|
||||
and bp.psv_id = (
|
||||
select v.psv_id from prc_price_set_version v
|
||||
where v.price_type = 'PRODUCT' and v.price_set_id is null and v.status = '1'
|
||||
order by v.version_seq desc limit 1
|
||||
)
|
||||
left join (
|
||||
select bp0.psd_id, bp0.product_code, bp0.country_code, bp0.zone_code,
|
||||
bp0.weight_min, bp0.weight_max, bp0.fv_value, bp0.fv_registration_fee
|
||||
from prc_price_set_detail bp0
|
||||
where bp0.price_type = 'PRODUCT'
|
||||
and ifnull(bp0.is_del, '0') = '0'
|
||||
and bp0.psv_id = (
|
||||
select v.psv_id from prc_price_set_version v
|
||||
where v.price_type = 'PRODUCT' and v.price_set_id is null and v.status = '1'
|
||||
order by v.version_seq desc limit 1
|
||||
)
|
||||
) bp
|
||||
on bp.product_code = d.product_code
|
||||
and bp.country_code <=> d.country_code
|
||||
and bp.zone_code <=> d.zone_code
|
||||
and bp.weight_min <=> d.weight_min
|
||||
and bp.weight_max <=> d.weight_max
|
||||
<where>
|
||||
and ifnull(d.is_del, '0') = '0'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user