规格回收站bug

This commit is contained in:
xuelijun
2025-08-25 11:01:25 +08:00
parent eeab4e5ea3
commit 27e51b6278
15 changed files with 317 additions and 175 deletions

View File

@@ -28,11 +28,11 @@
<result property="responseTimeSlots" column="erc_response_time_slots"/>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodEmergencyResponseBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
<id property="id" column="erc_record_id"/>
<result property="dateType" column="erc_date_type"/>
<result property="customTimeSlots" column="erc_custom_time_slots"/>
<result property="type" column="erc_type"/>
<result property="isEnabled" column="erc_is_enabled"/>
<id property="id" column="eblack_record_id"/>
<result property="dateType" column="eblack_date_type"/>
<result property="customTimeSlots" column="eblack_custom_time_slots"/>
<result property="type" column="eblack_type"/>
<result property="isEnabled" column="eblack_is_enabled"/>
</collection>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
@@ -56,13 +56,14 @@
<result property="changeTimeRule" column="rc_change_time_rule"/>
<result property="timeSlot" column="rc_time_slot"/>
<result property="maxChangeTimes" column="rc_max_change_times"/>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodReservationBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
<id property="id" column="rcp_record_id"/>
<result property="dateType" column="rcp_date_type"/>
<result property="customTimeSlots" column="rcp_custom_time_slots"/>
<result property="type" column="rcp_type"/>
<result property="isEnabled" column="rcp_is_enabled"/>
<collection property="prodReservationBlackList"
ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO"> <!-- 所有 blacklist 字段加 black_ 前缀 -->
<id property="id" column="black_id"/>
<result property="dateType" column="black_date_type"/>
<result property="customTimeSlots" column="black_custom_time_slots"/>
<result property="type" column="black_type"/>
<result property="isEnabled" column="black_is_enabled"/>
</collection>
</association>
@@ -105,6 +106,7 @@
</collection>
</association>
<!-- 新增:映射特殊日期规则配置列表 (prodAdditionalFeePeriodsList) -->
<collection property="prodAdditionalFeePeriodsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO">
<id property="id" column="afp_record_id"/>
@@ -128,16 +130,10 @@
<result property="price" column="afd_price"/>
<result property="isEnabled" column="afd_is_enabled"/>
</collection>
<!-- 映射服务区域地址名称 (areaNameList) -->
<!--<collection property="prodServiceAreasInfo.areaNameList" ofType="string">
<result column="sa_area_name"/>
</collection>-->
</resultMap>
@@ -162,11 +158,11 @@
<result property="responseTimeSlots" column="erc_response_time_slots"/>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodEmergencyResponseBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
<id property="id" column="erc_record_id"/>
<result property="dateType" column="erc_date_type"/>
<result property="customTimeSlots" column="erc_custom_time_slots"/>
<result property="type" column="erc_type"/>
<result property="isEnabled" column="erc_is_enabled"/>
<id property="id" column="eblack_record_id"/>
<result property="dateType" column="eblack_date_type"/>
<result property="customTimeSlots" column="eblack_custom_time_slots"/>
<result property="type" column="eblack_type"/>
<result property="isEnabled" column="eblack_is_enabled"/>
</collection>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
@@ -190,13 +186,13 @@
<result property="changeTimeRule" column="rc_change_time_rule"/>
<result property="timeSlot" column="rc_time_slot"/>
<result property="maxChangeTimes" column="rc_max_change_times"/>
<!-- 嵌套集合:紧急响应时间区间 -->
<collection property="prodReservationBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
<id property="id" column="rcp_record_id"/>
<result property="dateType" column="rcp_date_type"/>
<result property="customTimeSlots" column="rcp_custom_time_slots"/>
<result property="type" column="rcp_type"/>
<result property="isEnabled" column="rcp_is_enabled"/>
<collection property="prodReservationBlackList"
ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO"> <!-- 所有 blacklist 字段加 black_ 前缀 -->
<id property="id" column="black_id"/>
<result property="dateType" column="black_date_type"/>
<result property="customTimeSlots" column="black_custom_time_slots"/>
<result property="type" column="black_type"/>
<result property="isEnabled" column="black_is_enabled"/>
</collection>
</association>
@@ -262,6 +258,7 @@
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
<select id="selectProdService" parameterType="map" resultMap="ProdServiceResultMap">
SELECT
p.prod_id,
p.emergency_switch,
p.additional_switch,
p.additional_fee_switch,
@@ -278,11 +275,13 @@
<if test="emergencySwitch != null and emergencySwitch == 1">
erc.id AS erc_record_id,
erc.response_time_slots as erc_response_time_slots,
epafd.id AS erc_record_id,
epafd.date_type as erc_date_type,
epafd.custom_time_slots as erc_custom_time_slots,
epafd.type as erc_type,
epafd.is_enabled as erc_is_enabled,
epafd.id AS eblack_record_id,
epafd.date_type as eblack_date_type,
epafd.custom_time_slots as eblack_custom_time_slots,
epafd.type as eblack_type,
epafd.is_enabled as eblack_is_enabled,
eri.id AS eri_record_id,
eri.config_id AS eri_config_id,
eri.mode_name,
@@ -334,11 +333,13 @@
rc.change_time_rule AS rc_change_time_rule,
rc.time_slot AS rc_time_slot,
rc.max_change_times AS rc_max_change_times,
rpafd.id AS rcp_record_id,
rpafd.date_type as rcp_date_type,
rpafd.custom_time_slots as rcp_custom_time_slots,
rpafd.type as rcp_type,
rpafd.is_enabled as rcp_is_enabled,
rpafd.id AS black_id,
rpafd.date_type as black_date_type,
rpafd.custom_time_slots as black_custom_time_slots,
rpafd.type as black_type,
rpafd.is_enabled as black_is_enabled,
</if>
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
@@ -364,13 +365,13 @@
sa.fee AS sa_fee,
saa.area_name AS sa_area_name,
</if>
p.prod_id
p.prod_name
FROM
tz_prod p
<!-- 只有当 emergencySwitch 开启时才进行 LEFT JOIN -->
<if test="emergencySwitch != null and emergencySwitch == 1">
LEFT JOIN tz_prod_emergency_response erc ON p.prod_id = erc.prod_id AND erc.deleted = 0
LEFT JOIN tz_prod_additional_fee_dates epafd ON erc.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
LEFT JOIN tz_prod_additional_fee_dates epafd ON p.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
LEFT JOIN tz_prod_emergency_response_intervals eri ON erc.id = eri.config_id AND eri.deleted = 0
</if>
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
@@ -381,7 +382,7 @@
</if>
<if test="reservationSwitch != null and reservationSwitch == 1">
LEFT JOIN tz_prod_reservation_config rc ON p.prod_id = rc.prod_id AND rc.deleted = 0
LEFT JOIN tz_prod_additional_fee_dates rpafd ON rc.id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
LEFT JOIN tz_prod_additional_fee_dates rpafd ON p.prod_id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
</if>
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
LEFT JOIN tz_product_order_limit ol ON p.prod_id = ol.prod_id AND ol.deleted = 0
@@ -407,6 +408,7 @@
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
<select id="selectProdServiceInfo" parameterType="map" resultMap="ProdServiceResultInfoMap">
SELECT
p.prod_id,
p.emergency_switch,
p.additional_switch,
p.additional_fee_switch,
@@ -418,11 +420,13 @@
<if test="emergencySwitch != null and emergencySwitch == 1">
erc.id AS erc_record_id,
erc.response_time_slots as erc_response_time_slots,
epafd.id AS erc_record_id,
epafd.date_type as erc_date_type,
epafd.custom_time_slots as erc_custom_time_slots,
epafd.type as erc_type,
epafd.is_enabled as erc_is_enabled,
epafd.id AS eblack_record_id,
epafd.date_type as eblack_date_type,
epafd.custom_time_slots as eblack_custom_time_slots,
epafd.type as eblack_type,
epafd.is_enabled as eblack_is_enabled,
eri.id AS eri_record_id,
eri.config_id AS eri_config_id,
eri.mode_name,
@@ -474,11 +478,12 @@
rc.change_time_rule AS rc_change_time_rule,
rc.time_slot AS rc_time_slot,
rc.max_change_times AS rc_max_change_times,
rpafd.id AS rcp_record_id,
rpafd.date_type as rcp_date_type,
rpafd.custom_time_slots as rcp_custom_time_slots,
rpafd.type as rcp_type,
rpafd.is_enabled as rcp_is_enabled,
rpafd.id AS black_id,
rpafd.date_type as black_date_type,
rpafd.custom_time_slots as black_custom_time_slots,
rpafd.type as black_type,
rpafd.is_enabled as black_is_enabled,
</if>
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
@@ -496,13 +501,13 @@
wrp.price AS wrp_price,
wrp.is_enabled AS wrp_is_enabled,
</if>
p.prod_id
p.prod_name
FROM
tz_prod p
<!-- 只有当 emergencySwitch 开启时才进行 LEFT JOIN -->
<if test="emergencySwitch != null and emergencySwitch == 1">
LEFT JOIN tz_prod_emergency_response erc ON p.prod_id = erc.prod_id AND erc.deleted = 0
LEFT JOIN tz_prod_additional_fee_dates epafd ON erc.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
LEFT JOIN tz_prod_additional_fee_dates epafd ON p.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
LEFT JOIN tz_prod_emergency_response_intervals eri ON erc.id = eri.config_id AND eri.deleted = 0
</if>
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
@@ -513,7 +518,7 @@
</if>
<if test="reservationSwitch != null and reservationSwitch == 1">
LEFT JOIN tz_prod_reservation_config rc ON p.prod_id = rc.prod_id AND rc.deleted = 0
LEFT JOIN tz_prod_additional_fee_dates rpafd ON rc.id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
LEFT JOIN tz_prod_additional_fee_dates rpafd ON p.prod_id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
</if>
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
LEFT JOIN tz_product_order_limit ol ON p.prod_id = ol.prod_id AND ol.deleted = 0

View File

@@ -62,7 +62,7 @@
<update id="deleteProdPropValueById">
UPDATE tz_prod_prop_value
SET
is_expire = 1, delete_time = NOW()
deleted = 1, delete_time = NOW()
WHERE id = #{id}
</update>
@@ -87,10 +87,20 @@
FROM tz_prod_prop pp
JOIN tz_prod_prop_value ppv ON pp.id = ppv.prop_id
WHERE pp.prod_id = #{prodId}
AND ppv.is_expire = 1
AND (ppv.is_expire = 1 or ppv.deleted = 1)
<if test="propValue != null and propValue != ''">
and prop_value like concat('%', #{propValue}, '%')
</if>
</select>
<select id="getskuListByPropValueIds" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO">
SELECT *
FROM tz_prod_prop_value
WHERE id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

View File

@@ -84,10 +84,31 @@
</foreach>
</select>
<select id="getskuListByDeleted" resultType="com.tashow.cloud.productapi.api.product.dto.SkuDO">
SELECT *
FROM tz_sku
WHERE prod_id = #{prodId} AND deleted = 1 and sku_id not IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateSkuDeleted">
UPDATE tz_sku
SET deleted = 0
WHERE sku_id = #{skuId}
</update>
<update id="batchSkuRecover">
UPDATE tz_sku
SET deleted = 0
WHERE sku_id IN
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>