更新价格计算逻辑,添加套餐价格匹配和计费相关的国际化消息,优化数据库查询和删除操作
This commit is contained in:
@@ -328,39 +328,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and psv_id = #{psvId}
|
||||
</if>
|
||||
and product_code = #{productCode}
|
||||
and (
|
||||
<if test="productCountryId != null">
|
||||
product_country_id = #{productCountryId}
|
||||
or
|
||||
</if>
|
||||
(
|
||||
<choose>
|
||||
<when test="countryCode != null and countryCode != ''">
|
||||
upper(ifnull(country_code,'')) = upper(#{countryCode})
|
||||
</when>
|
||||
<when test="countryName != null and countryName != ''">
|
||||
country_name = #{countryName}
|
||||
</when>
|
||||
<otherwise>
|
||||
1 = 0
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="zoneCode != null and zoneCode != ''">
|
||||
and (zone_code is null or upper(zone_code) = upper(#{zoneCode}))
|
||||
</if>
|
||||
<if test="weightLabel != null and weightLabel != ''">
|
||||
and (weight_label is null or weight_label = #{weightLabel} or weight_label like concat('%', #{weightLabel}, '%'))
|
||||
</if>
|
||||
)
|
||||
)
|
||||
<choose>
|
||||
<when test="countryCode != null and countryCode != ''">
|
||||
and upper(ifnull(country_code,'')) = upper(#{countryCode})
|
||||
</when>
|
||||
<when test="countryName != null and countryName != ''">
|
||||
and country_name = #{countryName}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1 = 0
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="zoneCode != null and zoneCode != ''">
|
||||
and upper(ifnull(zone_code,'')) = upper(#{zoneCode})
|
||||
</when>
|
||||
<otherwise>
|
||||
and (zone_code is null or zone_code = '')
|
||||
</otherwise>
|
||||
</choose>
|
||||
and weight_min <= #{weight}
|
||||
and weight_max >= #{weight}
|
||||
order by
|
||||
case when #{productCountryId} is not null and product_country_id = #{productCountryId} then 0 else 1 end,
|
||||
case when #{zoneCode} is not null and upper(ifnull(zone_code,'')) = upper(#{zoneCode}) then 0 else 1 end,
|
||||
case when zone_code is null then 1 else 0 end,
|
||||
weight_min asc,
|
||||
psd_id asc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="countZonedByPsvProductCountry" resultType="int">
|
||||
select count(1)
|
||||
from prc_price_set_detail
|
||||
where psv_id = #{psvId}
|
||||
and product_code = #{productCode}
|
||||
and zone_code is not null and zone_code <> ''
|
||||
<choose>
|
||||
<when test="countryCode != null and countryCode != ''">
|
||||
and upper(ifnull(country_code,'')) = upper(#{countryCode})
|
||||
</when>
|
||||
<when test="countryName != null and countryName != ''">
|
||||
and country_name = #{countryName}
|
||||
</when>
|
||||
<otherwise>
|
||||
and 1 = 0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectDiscountMatch" resultMap="PrcPriceSetDetailResult">
|
||||
<include refid="selectPrcPriceSetDetailVo"/>
|
||||
where price_set_id = #{priceSetId}
|
||||
|
||||
@@ -134,6 +134,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletePrcQuoteById" parameterType="String">
|
||||
delete from prc_quote where quote_id = #{quoteId}
|
||||
</delete>
|
||||
|
||||
<update id="updateQuoteAmounts">
|
||||
update prc_quote
|
||||
set surcharge_amount = #{surchargeAmount},
|
||||
|
||||
Reference in New Issue
Block a user