Merge branch 'test'

This commit is contained in:
caojia
2026-11-02 09:17:44 +08:00
28 changed files with 615 additions and 100 deletions
@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="customerCodeDw" column="customer_code_dw" />
<result property="creditCode" column="credit_code" />
<result property="customerType" column="customer_type" />
<result property="areaType" column="area_type" />
<result property="isEnable" column="is_enable" />
<result property="salesUserId" column="sales_user_id" />
<result property="salesUser" column="sales_user" />
@@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 账户余额/外币余额统一取 ctr_customer_account 余额表(CNY 为本币,其余为外币),不取 ctr_customer 冗余列 -->
<!-- 信用额度=总额度+额外额度-已用额度-->
<sql id="selectBmsCustomerVo">
select c.customer_id, c.customer_code, c.customer_name, c.customer_code_dw, c.credit_code, c.customer_type,
select c.customer_id, c.customer_code, c.customer_name, c.customer_code_dw, c.credit_code, c.customer_type, c.area_type,
c.is_enable,
case when su.user_id is not null then cast(su.user_id as char) else null end as sales_user_id,
su.nick_name as sales_user, c.ed, c.zq, c.settlement_user_id, c.settlement_user,
@@ -91,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="creditCode != null and creditCode != ''"> and c.credit_code = #{creditCode}</if>
<if test="customerType != null and customerType != ''"> and c.customer_type = #{customerType}</if>
<if test="areaType != null and areaType != ''"> and c.area_type = #{areaType}</if>
<if test="isEnable != null and isEnable != ''"> and c.is_enable = #{isEnable}</if>
<if test="salesUserId != null and salesUserId != ''"> and c.sales_user_id = #{salesUserId}</if>
<if test="salesUser != null and salesUser != ''"> and su.nick_name = #{salesUser}</if>
@@ -315,6 +317,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerCodeDw != null">customer_code_dw,</if>
<if test="creditCode != null">credit_code,</if>
<if test="customerType != null">customer_type,</if>
<if test="areaType != null">area_type,</if>
<if test="isEnable != null">is_enable,</if>
<if test="salesUserId != null">sales_user_id,</if>
<if test="salesUser != null">sales_user,</if>
@@ -347,6 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerCodeDw != null">#{customerCodeDw},</if>
<if test="creditCode != null">#{creditCode},</if>
<if test="customerType != null">#{customerType},</if>
<if test="areaType != null">#{areaType},</if>
<if test="isEnable != null">#{isEnable},</if>
<if test="salesUserId != null">#{salesUserId},</if>
<if test="salesUser != null">#{salesUser},</if>
@@ -383,6 +387,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerCodeDw != null">customer_code_dw = #{customerCodeDw},</if>
<if test="creditCode != null">credit_code = #{creditCode},</if>
<if test="customerType != null">customer_type = #{customerType},</if>
area_type = #{areaType},
<if test="isEnable != null">is_enable = #{isEnable},</if>
sales_user_id = #{salesUserId},
sales_user = #{salesUser},
@@ -357,6 +357,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1
</select>
<select id="selectMinBandByProductCountry" resultMap="BmsProductCountryResult">
<include refid="selectVo"/>
where c.price_type = 'PRODUCT'
and ifnull(c.is_del, '0') = '0'
and c.product_code = #{productCode}
and c.weight_min is not null
<include refid="catalogBizWindow"/>
<choose>
<when test="countryCode != null and countryCode != ''">
and upper(c.country_code) = upper(#{countryCode})
</when>
<when test="countryName != null and countryName != ''">
and c.country_name = #{countryName}
</when>
<otherwise>
and 1 = 0
</otherwise>
</choose>
<choose>
<when test="zoneCode != null and zoneCode != ''">
and upper(ifnull(c.zone_code,'')) = upper(#{zoneCode})
</when>
<otherwise>
and (c.zone_code is null or c.zone_code = '')
</otherwise>
</choose>
order by v.effective_time desc, c.weight_min asc, c.psd_id asc
limit 1
</select>
<select id="countZonedByProductCountry" resultType="int">
select count(1)
from prc_price_set_detail c
@@ -141,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updatePrcCustomerPriceSet" parameterType="PrcCustomerPriceSet">
update prc_customer_price_set
<set>
<if test="priceSetId != null">price_set_id = #{priceSetId},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerCode != null">customer_code = #{customerCode},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
@@ -490,6 +490,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1
</select>
<select id="selectFixedMinBand" resultMap="PrcPriceSetDetailResult">
<include refid="selectPrcPriceSetDetailVo"/>
where psv_id = #{psvId}
and ifnull(is_del, '0') = '0'
and product_code = #{productCode}
and weight_min is not null
<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>
order by weight_min asc, psd_id asc
limit 1
</select>
<select id="countZonedByPsvProductCountry" resultType="int">
select count(1)
from prc_price_set_detail