修改套餐规则
This commit is contained in:
@@ -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 <= #{asOf}
|
||||
and (expire_time is null or expire_time > #{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 <= #{asOf}
|
||||
and (expire_time is null or expire_time > #{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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user