修改套餐规则

This commit is contained in:
wuweihua
2026-10-28 18:10:10 +08:00
parent 2bd417b84e
commit 8ed7b3146b
21 changed files with 536 additions and 411 deletions
@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="expireTime" column="expire_time" />
<result property="status" column="status" />
<result property="priceBuildMode" column="price_build_mode"/>
<result property="isDel" column="is_del" />
<result property="createBy" column="created_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="updated_by" />
@@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectPrcPriceSetVersionVo">
select psv_id, price_set_id, price_type, version_no, version_seq, effective_time, expire_time, status,
price_build_mode, created_by, create_time, updated_by, update_time
price_build_mode, is_del, created_by, create_time, updated_by, update_time
from prc_price_set_version
</sql>
@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPrcPriceSetVersionList" parameterType="PrcPriceSetVersion" resultMap="PrcPriceSetVersionResult">
<include refid="selectPrcPriceSetVersionVo"/>
<where>
and ifnull(is_del, '0') = '0'
<if test="priceSetId != null">
AND price_set_id = #{priceSetId}
</if>
@@ -57,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCatalogVersionList" parameterType="PrcPriceSetVersion" resultMap="PrcPriceSetVersionResult">
select v.psv_id, v.price_set_id, v.price_type, v.version_no, v.version_seq,
v.effective_time, v.expire_time, v.status, v.price_build_mode,
v.effective_time, v.expire_time, v.status, v.price_build_mode, v.is_del,
v.created_by, v.create_time, v.updated_by, v.update_time,
(select count(1) from prc_price_set_product p
where p.psv_id = v.psv_id and ifnull(p.is_del, '0') = '0') as product_count,
@@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from prc_price_set_version v
where v.price_set_id is null
and v.price_type = #{priceType}
and ifnull(v.is_del, '0') = '0'
<choose>
<when test="statusGroup != null and statusGroup == 'pending'">
and v.status in ('0', '3')
@@ -162,6 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPrcPriceSetVersionVo"/>
where price_type = 'SALES'
and price_set_id = #{priceSetId}
and ifnull(is_del, '0') = '0'
and effective_time is not null
and effective_time &lt;= #{asOf}
and (expire_time is null or expire_time &gt; #{asOf})
@@ -173,6 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPrcPriceSetVersionVo"/>
where price_type = #{priceType}
and price_set_id is null
and ifnull(is_del, '0') = '0'
and effective_time is not null
and effective_time &lt;= #{asOf}
and (expire_time is null or expire_time &gt; #{asOf})
@@ -180,6 +185,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1
</select>
<update id="softDeleteById">
update prc_price_set_version
set is_del = '1',
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
update_time = sysdate()
where psv_id = #{psvId}
and ifnull(is_del, '0') = '0'
</update>
<update id="refreshCatalogStatusByDates">
update prc_price_set_version
set status = case
@@ -191,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time = sysdate()
where price_type = #{priceType}
and price_set_id is null
and ifnull(is_del, '0') = '0'
and status in ('0','1','2','3')
</update>
@@ -166,6 +166,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</delete>
<update id="softDeleteByPsvId">
update prc_surcharge_rel r
set r.is_del = '1', r.update_time = sysdate()
where ifnull(r.is_del, '0') = '0'
and (
exists (
select 1 from prc_price_set_product p
where p.psp_id = r.product_id and p.psv_id = #{psvId}
)
or exists (
select 1 from prc_price_set_detail d
where d.psd_id = r.detail_id and d.psv_id = #{psvId}
)
)
</update>
<!-- 附加费版本化编辑后,产品关联重指向新记录 -->
<update id="rebindRelScId">
update prc_surcharge_rel