修改价格套餐版本

This commit is contained in:
wuweihua
2026-09-17 10:41:19 +08:00
parent f76c90643e
commit 5fe2351990
21 changed files with 668 additions and 116 deletions
@@ -97,8 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from prc_customer_price_set c
inner join prc_price_set s on s.price_set_id = c.price_set_id
where c.customer_id = #{customerId}
and s.status = 'E'
and c.pr_begindate <= #{bizDate}
and ifnull(s.status, 'D') <> 'S'
and (c.pr_begindate is null or c.pr_begindate <= #{bizDate})
and ifnull(c.pr_enddate, '9999-12-31') >= #{bizDate}
order by c.bind_priority asc, c.pr_begindate desc, c.customer_priceset_id asc
</select>
@@ -110,8 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from prc_customer_price_set c
inner join prc_price_set s on s.price_set_id = c.price_set_id
where c.customer_code = #{customerCode}
and s.status = 'E'
and c.pr_begindate &lt;= #{bizDate}
and ifnull(s.status, 'D') &lt;&gt; 'S'
and (c.pr_begindate is null or c.pr_begindate &lt;= #{bizDate})
and ifnull(c.pr_enddate, '9999-12-31') &gt;= #{bizDate}
order by c.bind_priority asc, c.pr_begindate desc, c.customer_priceset_id asc
</select>
@@ -63,6 +63,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="zoneCode != null and zoneCode != ''">
AND zone_code = #{zoneCode}
</if>
<if test="productKeyword != null and productKeyword != ''">
AND (
product_code like concat('%', #{productKeyword}, '%')
or product_name like concat('%', #{productKeyword}, '%')
)
</if>
<if test="countryKeyword != null and countryKeyword != ''">
AND (
country_code like concat('%', #{countryKeyword}, '%')
or country_name like concat('%', #{countryKeyword}, '%')
)
</if>
<if test="zoneKeyword != null and zoneKeyword != ''">
AND (
zone_code like concat('%', #{zoneKeyword}, '%')
or zone_name like concat('%', #{zoneKeyword}, '%')
)
</if>
<if test="keyword != null and keyword != ''">
AND (
product_code like concat('%', #{keyword}, '%')
@@ -269,6 +287,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectFixedMatch" resultMap="PrcPriceSetDetailResult">
<include refid="selectPrcPriceSetDetailVo"/>
where price_set_id = #{priceSetId}
<if test="psvId != null">
and psv_id = #{psvId}
</if>
and product_code = #{productCode}
and (
<if test="productCountryId != null">
@@ -306,6 +327,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDiscountMatch" resultMap="PrcPriceSetDetailResult">
<include refid="selectPrcPriceSetDetailVo"/>
where price_set_id = #{priceSetId}
<if test="psvId != null">
and psv_id = #{psvId}
</if>
and product_code = #{productCode}
order by psd_id asc
limit 1
@@ -100,4 +100,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select distinct price_set_id from prc_price_set_version
</select>
<select id="selectActiveByPriceSetAt" resultMap="PrcPriceSetVersionResult">
<include refid="selectPrcPriceSetVersionVo"/>
where price_set_id = #{priceSetId}
and effective_time is not null
and effective_time &lt;= #{asOf}
and (expire_time is null or expire_time &gt; #{asOf})
order by effective_time desc, version_seq desc, psv_id desc
limit 1
</select>
</mapper>