修改基础价格版本功能

This commit is contained in:
wuweihua
2026-09-28 15:45:07 +08:00
parent 1083c2876f
commit 32ab61b51c
22 changed files with 831 additions and 132 deletions
@@ -151,23 +151,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.effective_date,
c.expire_date,
sysdate()
from bms_product p
inner join bms_product_country c on c.product_id = p.product_id
where p.status = '1'
and p.product_id = (
select max(p2.product_id) from bms_product p2
where p2.product_code = p.product_code and p2.status = '1'
)
and ifnull(c.status, '1') <> '2'
<choose>
<when test="openOnly">
and (c.expire_date is null or date(c.expire_date) &gt; curdate())
</when>
<otherwise>
and date(c.effective_date) &lt;= date(#{asOf})
and (c.expire_date is null or date(c.expire_date) &gt; date(#{asOf}))
</otherwise>
</choose>
from bms_product_country c
inner join bms_product p on p.product_id = c.product_id
<where>
<choose>
<when test="baseVersionNo != null and baseVersionNo != ''">
and exists (
select 1 from bms_product_price_version v
where v.ppv_id = c.ppv_id
and v.version_no = #{baseVersionNo}
)
</when>
<otherwise>
and p.status = '1'
and p.product_id = (
select max(p2.product_id) from bms_product p2
where p2.product_code = p.product_code and p2.status = '1'
)
and ifnull(c.status, '1') &lt;&gt; '2'
<choose>
<when test="openOnly">
and (c.expire_date is null or date(c.expire_date) &gt; curdate())
</when>
<otherwise>
and date(c.effective_date) &lt;= date(#{asOf})
and (c.expire_date is null or date(c.expire_date) &gt; date(#{asOf}))
</otherwise>
</choose>
</otherwise>
</choose>
</where>
order by p.product_code asc, c.country_name asc, c.zone_code asc, c.weight_min asc, c.detail_id asc
</insert>
@@ -183,11 +196,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'HALF_UP',
sysdate()
from bms_product p
where p.status = '1'
and p.product_id = (
select max(p2.product_id) from bms_product p2
where p2.product_code = p.product_code and p2.status = '1'
)
<where>
<choose>
<when test="baseVersionNo != null and baseVersionNo != ''">
and exists (
select 1 from bms_product_country c
inner join bms_product_price_version v on v.ppv_id = c.ppv_id
where c.product_id = p.product_id
and v.version_no = #{baseVersionNo}
)
</when>
<otherwise>
and p.status = '1'
and p.product_id = (
select max(p2.product_id) from bms_product p2
where p2.product_code = p.product_code and p2.status = '1'
)
</otherwise>
</choose>
</where>
order by p.product_code asc
</insert>