套餐加分区功能

This commit is contained in:
wuweihua
2026-09-15 14:10:44 +08:00
parent 76208604bb
commit 7679a7d091
26 changed files with 1279 additions and 597 deletions
@@ -10,6 +10,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productCode" column="product_code" />
<result property="countryName" column="country_name" />
<result property="countryCode" column="country_code" />
<result property="zoneId" column="zone_id" />
<result property="zoneCode" column="zone_code" />
<result property="zoneName" column="zone_name" />
<result property="weightMin" column="weight_min" />
<result property="weightMax" column="weight_max" />
<result property="freightPrice" column="freight_price" />
@@ -26,7 +29,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectVo">
select detail_id, product_id, product_code, country_name, country_code, weight_min, weight_max,
select detail_id, product_id, product_code, country_name, country_code, zone_id, zone_code, zone_name,
weight_min, weight_max,
freight_price, registration_fee, size_limit, last_mile, lead_time,
effective_date, expire_date, status, create_time, update_time
from bms_product_country
@@ -47,6 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="countryCode != null and countryCode != ''">
AND country_code = #{countryCode}
</if>
<if test="zoneId != null">
AND zone_id = #{zoneId}
</if>
<if test="zoneCode != null and zoneCode != ''">
AND zone_code = #{zoneCode}
</if>
<if test="weightMin != null">
AND weight_min = #{weightMin}
</if>
@@ -66,16 +76,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND status = #{effectStatus}
</if>
</where>
order by effective_date desc, country_name asc, weight_min asc, detail_id asc
order by effective_date desc, country_name asc, zone_code asc, weight_min asc, detail_id asc
</select>
<insert id="insertBmsProductCountry" parameterType="BmsProductCountry" useGeneratedKeys="true" keyProperty="detailId">
insert into bms_product_country (
product_id, product_code, country_name, country_code, weight_min, weight_max,
product_id, product_code, country_name, country_code, zone_id, zone_code, zone_name,
weight_min, weight_max,
freight_price, registration_fee, size_limit, last_mile, lead_time,
effective_date, expire_date, status, create_time
) values (
#{productId}, #{productCode}, #{countryName}, #{countryCode}, #{weightMin}, #{weightMax},
#{productId}, #{productCode}, #{countryName}, #{countryCode}, #{zoneId}, #{zoneCode}, #{zoneName},
#{weightMin}, #{weightMax},
#{freightPrice}, #{registrationFee}, #{sizeLimit}, #{lastMile}, #{leadTime},
#{effectiveDate}, #{expireDate}, IFNULL(#{status}, '0'), sysdate()
)
@@ -162,7 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bizDate == null">
and expire_date is null
</if>
order by effective_date desc, weight_min asc, detail_id asc
order by
case when zone_code is null or zone_code = '' then 0 else 1 end,
effective_date desc, weight_min asc, detail_id asc
limit 1
</select>
@@ -11,6 +11,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productName" column="product_name" />
<result property="countryCode" column="country_code" />
<result property="countryName" column="country_name" />
<result property="zoneId" column="zone_id" />
<result property="zoneCode" column="zone_code" />
<result property="zoneName" column="zone_name" />
<result property="zdId" column="zd_id" />
<result property="wsdId" column="wsd_id" />
<result property="weightLabel" column="weight_label" />
@@ -26,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectPrcPriceSetDetailVo">
select psd_id, price_set_id, product_code, product_name, country_code, country_name,
zone_id, zone_code, zone_name,
zd_id, wsd_id, weight_label, product_country_id, fv_value, fv_registration_fee,
discount_value, round_mode, pr_id, create_time, update_time
from prc_price_set_detail
@@ -48,6 +52,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="countryCode != null and countryCode != ''">
AND country_code = #{countryCode}
</if>
<if test="zoneCode != null and zoneCode != ''">
AND zone_code = #{zoneCode}
</if>
</where>
order by psd_id asc
</select>
@@ -67,6 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">product_name,</if>
<if test="countryCode != null">country_code,</if>
<if test="countryName != null">country_name,</if>
<if test="zoneId != null">zone_id,</if>
<if test="zoneCode != null">zone_code,</if>
<if test="zoneName != null">zone_name,</if>
<if test="zdId != null">zd_id,</if>
<if test="wsdId != null">wsd_id,</if>
<if test="weightLabel != null">weight_label,</if>
@@ -83,6 +93,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">#{productName},</if>
<if test="countryCode != null">#{countryCode},</if>
<if test="countryName != null">#{countryName},</if>
<if test="zoneId != null">#{zoneId},</if>
<if test="zoneCode != null">#{zoneCode},</if>
<if test="zoneName != null">#{zoneName},</if>
<if test="zdId != null">#{zdId},</if>
<if test="wsdId != null">#{wsdId},</if>
<if test="weightLabel != null">#{weightLabel},</if>
@@ -103,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null">product_name = #{productName},</if>
country_code = #{countryCode},
country_name = #{countryName},
zone_id = #{zoneId},
zone_code = #{zoneCode},
zone_name = #{zoneName},
zd_id = #{zdId},
wsd_id = #{wsdId},
weight_label = #{weightLabel},
@@ -149,6 +165,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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>
@@ -156,6 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
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,
psd_id asc
limit 1
</select>