获取服务信息
This commit is contained in:
@@ -38,9 +38,9 @@ public class ProdEmergencyResponseIntervalsDO extends BaseDO {
|
||||
private Long prodId;
|
||||
|
||||
/**
|
||||
* 响应模式名称
|
||||
* 响应模式名称modeName
|
||||
*/
|
||||
private String modeName;
|
||||
private String name;
|
||||
/**
|
||||
* 响应时间(小时)
|
||||
*/
|
||||
|
||||
@@ -64,14 +64,14 @@ public class ProdServiceInfoVO {
|
||||
public ProductOrderLimitDO productOrderLimitVO;
|
||||
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开 ")
|
||||
private Integer additionalSwitch;
|
||||
@Schema(description = "特殊时段规则配置")
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
private Integer additionalFeeSwitch;
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
@Schema(description = "特殊时段规则配置 ")
|
||||
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
|
||||
|
||||
|
||||
|
||||
@@ -78,14 +78,14 @@ public class ProdServiceVO {
|
||||
public ProductOrderLimitDO productOrderLimitVO;
|
||||
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Integer additionalSwitch;
|
||||
@Schema(description = "特殊时段规则配置")
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
@Schema(description = "是否特殊时段0关1开 ")
|
||||
private Integer additionalFeeSwitch;
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
@Schema(description = "特殊时段规则配置 ")
|
||||
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ProdEmergencyResponseIntervalsPageReqVO extends PageParam {
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", example = "王五")
|
||||
private String modeName;
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)")
|
||||
private BigDecimal responseHours;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ProdEmergencyResponseIntervalsRespVO {
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("响应模式名称")
|
||||
private String modeName;
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("响应时间(小时)")
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ProdEmergencyResponseIntervalsSaveReqVO {
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "响应模式名称不能为空")
|
||||
private String modeName;
|
||||
private String name;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "响应时间(小时)不能为空")
|
||||
|
||||
@@ -30,24 +30,9 @@ public interface ProdMapper extends BaseMapperX<ProdDO> {
|
||||
, @Param("status") Integer status
|
||||
, @Param("categoryId") Long categoryId);
|
||||
|
||||
ProdServiceVO selectProdService(@Param("prodId") Long prodId
|
||||
, @Param("regionSwitch") Integer regionSwitch
|
||||
, @Param("reservationSwitch") Integer reservationSwitch
|
||||
, @Param("emergencySwitch") Integer emergencySwitch
|
||||
, @Param("orderLimitSwitch") Integer orderLimitSwitch
|
||||
, @Param("additionalSwitch") Integer additionalSwitch
|
||||
, @Param("additionalFeeSwitch") Integer additionalFeeSwitch
|
||||
, @Param("weightSwitch") Integer weightSwitch
|
||||
);
|
||||
ProdServiceVO selectProdService(@Param("prodId") Long prodId);
|
||||
|
||||
ProdServiceVO selectProdServiceInfo(@Param("prodId") Long prodId
|
||||
, @Param("reservationSwitch") Integer reservationSwitch
|
||||
, @Param("emergencySwitch") Integer emergencySwitch
|
||||
, @Param("orderLimitSwitch") Integer orderLimitSwitch
|
||||
, @Param("additionalSwitch") Integer additionalSwitch
|
||||
, @Param("additionalFeeSwitch") Integer additionalFeeSwitch
|
||||
, @Param("weightSwitch") Integer weightSwitch
|
||||
);
|
||||
ProdServiceVO selectProdServiceInfo(@Param("prodId") Long prodId);
|
||||
|
||||
IPage<ProdRestoreListVO> getProdRecycleBinPageList(Page<?> page, @Param("deleteTime") String[] deleteTime
|
||||
, @Param("prodName") String prodName);
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface ProdService {
|
||||
/**
|
||||
* 修改商品服务配置
|
||||
*
|
||||
* @param prodServiceVO 创建信息
|
||||
* @param prodServiceInfoVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
void uptateProdService(@Valid ProdServiceInfoVO prodServiceInfoVO);
|
||||
|
||||
@@ -245,6 +245,8 @@ public class ProdServiceImpl implements ProdService {
|
||||
prodReservationConfigDO.setTimeSlot(prodReservationInfoVO.getTimeBook().getTimeSlot());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodReservationInfoVO.getTimeBook().getReservationTimeSlots());
|
||||
prodReservationConfigMapper.insert(prodReservationConfigDO);
|
||||
//先删除在新增
|
||||
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 2);
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
@@ -282,6 +284,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
|
||||
prodEmergencyResponseIntervals.setId(null);
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
@@ -290,6 +293,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setId(null);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(3);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
@@ -302,6 +306,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
prodEmergencyResponseIntervalsMapper.deleteIntervals(prodEmergencyResponse.getId());
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
|
||||
prodEmergencyResponseIntervals.setId(null);
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
@@ -312,6 +317,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setId(null);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(3);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
@@ -359,7 +365,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
//体重设置
|
||||
if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prod.setWeightSwitch(BaseEnum.YES_ONE.getKey());
|
||||
prod.setWeightSwitch(prodServiceVO.getWeightSwitch());
|
||||
ProdExtendDO prodExtendDO = prodExtendMapper.selectOne(ProdExtendDO::getProdId, prod.getProdId());
|
||||
if (prodExtendDO != null) {
|
||||
prodExtendDO.setIsWeightCharge(prodServiceVO.getProdWeightConfig().getIsWeightCharge());
|
||||
@@ -377,7 +383,6 @@ public class ProdServiceImpl implements ProdService {
|
||||
prodWeightRangePricesMapper.insert(prodWeightRangePricesDO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
prodMapper.updateById(prod);
|
||||
}
|
||||
@@ -385,10 +390,29 @@ public class ProdServiceImpl implements ProdService {
|
||||
@Override
|
||||
public ProdServiceVO getProdService(Long prodId) {
|
||||
ProdDO prodDO = prodMapper.selectById(prodId);
|
||||
if (prodDO != null && prodDO.getRegionSwitch() == BaseEnum.YES_ONE.getKey()) {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId(), prodDO.getRegionSwitch(),
|
||||
prodDO.getReservationSwitch(), prodDO.getEmergencySwitch(), prodDO.getOrderLimitSwitch(),
|
||||
prodDO.getAdditionalSwitch(), prodDO.getAdditionalFeeSwitch(), prodDO.getWeightSwitch());
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId());
|
||||
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()== null) {
|
||||
prodServiceVO.setProdEmergencyInfoVO(null);
|
||||
}else {
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()!= null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().size()== 0) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()!= null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseBlackList(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
if (prodServiceVO.getProdAdditionalFeeDatesList().get(0).getId()==null) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (prodServiceVO.getProdAdditionalFeePeriodsList().get(0).getId()==null) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
/* if (prodDO != null && prodDO.getRegionSwitch() == BaseEnum.YES_ONE.getKey()) {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
@@ -405,29 +429,27 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
return prodServiceVO;
|
||||
} else {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdServiceInfo(prodDO.getProdId(),
|
||||
prodDO.getReservationSwitch(), prodDO.getEmergencySwitch(), prodDO.getOrderLimitSwitch(),
|
||||
prodDO.getAdditionalSwitch(), prodDO.getAdditionalFeeSwitch(), prodDO.getWeightSwitch());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdServiceInfo(prodDO.getProdId());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdReservationConfig()!=null&&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO()!=null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO()!=null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList()!=null&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList()!=null&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -417,24 +417,20 @@ public class SkuServiceImpl implements SkuService {
|
||||
ProdPropValueDO prodPropValueDO = prodPropValueMapper.selectById(id);
|
||||
ProdPropDO prodPropDO =prodPropMapper.selectById(prodPropValueDO.getPropId());
|
||||
List<SkuDO> skuDOList = skuMapper.getSkuListByName(prodPropDO.getProdId(),prodPropValueDO.getPropValue());
|
||||
prodPropValueDO.setPropValue(propValue);
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
List<Long> skuids = new ArrayList<>();
|
||||
for (SkuDO skuDO : skuDOList) {
|
||||
if (skuDO.getProperties() != null) {
|
||||
String[] split = skuDO.getProperties().split(",");
|
||||
for (String s : split) {
|
||||
if (s.equals(prodPropValueDO.getPropValue())) {
|
||||
skuDO.setProperties(prodPropValueDO.getPropValue());
|
||||
skuDO.setSkuName(prodPropValueDO.getPropValue());
|
||||
skuDO.setProperties(propValue);
|
||||
skuDO.setSkuName(propValue);
|
||||
skuMapper.updateById(skuDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuids)) {
|
||||
skuMapper.batchSkuDeleted(skuids);
|
||||
}
|
||||
prodPropValueDO.setPropValue(propValue);
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
|
||||
<id property="id" column="eri_record_id"/>
|
||||
<result property="configId" column="eri_config_id"/>
|
||||
<result property="modeName" column="mode_name"/>
|
||||
<result property="name" column="eri_name"/>
|
||||
<result property="responseHours" column="response_hours"/>
|
||||
<result property="chargeMode" column="charge_mode"/>
|
||||
<result property="floatingPercentage" column="floating_percentage"/>
|
||||
@@ -168,7 +168,7 @@
|
||||
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
|
||||
<id property="id" column="eri_record_id"/>
|
||||
<result property="configId" column="eri_config_id"/>
|
||||
<result property="modeName" column="mode_name"/>
|
||||
<result property="name" column="eri_name"/>
|
||||
<result property="responseHours" column="response_hours"/>
|
||||
<result property="chargeMode" column="charge_mode"/>
|
||||
<result property="floatingPercentage" column="floating_percentage"/>
|
||||
@@ -257,148 +257,135 @@
|
||||
<!-- 动态SQL查询商品列表及其服务配置 (返回 List<ProdServiceVO>) -->
|
||||
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
|
||||
<select id="selectProdService" parameterType="map" resultMap="ProdServiceResultMap">
|
||||
SELECT
|
||||
p.prod_id,
|
||||
p.emergency_switch,
|
||||
p.additional_switch,
|
||||
p.additional_fee_switch,
|
||||
p.reservation_switch,
|
||||
p.order_limit_switch,
|
||||
p.weight_switch,
|
||||
p.region_switch,
|
||||
p.create_time,
|
||||
p.update_time,
|
||||
p.creator,
|
||||
p.updater,
|
||||
p.category_name,
|
||||
<!-- 只有当 emergencySwitch 开启时,才查询紧急响应相关字段 -->
|
||||
<if test="emergencySwitch != null and emergencySwitch == 1">
|
||||
erc.id AS erc_record_id,
|
||||
erc.response_time_slots as erc_response_time_slots,
|
||||
SELECT p.prod_id,
|
||||
p.emergency_switch,
|
||||
p.additional_switch,
|
||||
p.additional_fee_switch,
|
||||
p.reservation_switch,
|
||||
p.order_limit_switch,
|
||||
p.weight_switch,
|
||||
p.region_switch,
|
||||
p.create_time,
|
||||
p.update_time,
|
||||
p.creator,
|
||||
p.updater,
|
||||
p.category_name,
|
||||
|
||||
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,
|
||||
erc.id AS erc_record_id,
|
||||
erc.response_time_slots as erc_response_time_slots,
|
||||
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.mode_name,
|
||||
eri.response_hours,
|
||||
eri.charge_mode,
|
||||
eri.floating_percentage,
|
||||
eri.price,
|
||||
eri.create_time AS eri_create_time,
|
||||
eri.update_time AS eri_update_time,
|
||||
eri.creator AS eri_creator,
|
||||
eri.updater AS eri_updater,
|
||||
eri.deleted AS eri_deleted,
|
||||
</if>
|
||||
<!-- 只有当 additionalFeeSwitch 开启时,才查询特殊日期规则相关字段 -->
|
||||
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
|
||||
afp.id AS afp_record_id,
|
||||
afp.prod_id AS afp_prod_id,
|
||||
afp.name AS afp_name,
|
||||
afp.special_time_slots AS afp_special_time_slots,
|
||||
afp.charge_mode AS afp_charge_mode,
|
||||
afp.price AS afp_price,
|
||||
afp.floating_percentage AS afp_floating_percentage,
|
||||
</if>
|
||||
<!-- 只有当 additionalSwitch 开启时,才查询特殊时段规则相关字段 -->
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
afd.id AS afd_record_id,
|
||||
afd.prod_id AS afd_prod_id,
|
||||
afd.name AS afd_name,
|
||||
afd.date_type AS afd_date_type,
|
||||
afd.custom_time_slots AS afd_custom_time_slots,
|
||||
afd.specific_dates AS afd_specific_dates,
|
||||
afd.charge_mode AS afd_charge_mode,
|
||||
afd.price AS afd_price,
|
||||
afd.is_enabled AS afd_is_enabled,
|
||||
afd.create_time AS afd_create_time,
|
||||
afd.update_time AS afd_update_time,
|
||||
afd.creator AS afd_creator,
|
||||
afd.updater AS afd_updater,
|
||||
afd.deleted AS afd_deleted,
|
||||
</if>
|
||||
<!-- 只有当 reservationSwitch 开启时,才查询预约配置相关字段 -->
|
||||
<if test="reservationSwitch != null and reservationSwitch == 1">
|
||||
rc.id AS rc_record_id,
|
||||
rc.prod_id AS rc_prod_id,
|
||||
rc.reservation_time_slots AS rc_reservation_time_slots,
|
||||
rc.advance_hours AS rc_advance_hours,
|
||||
rc.reservation_date_range AS rc_reservation_date_range,
|
||||
rc.allow_change AS rc_allow_change,
|
||||
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,
|
||||
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,
|
||||
|
||||
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,
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.name as eri_name,
|
||||
eri.response_hours,
|
||||
eri.charge_mode,
|
||||
eri.floating_percentage,
|
||||
eri.price,
|
||||
eri.create_time AS eri_create_time,
|
||||
eri.update_time AS eri_update_time,
|
||||
eri.creator AS eri_creator,
|
||||
eri.updater AS eri_updater,
|
||||
eri.deleted AS eri_deleted,
|
||||
|
||||
</if>
|
||||
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
|
||||
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
|
||||
ol.id AS ol_record_id,
|
||||
ol.prod_id AS ol_prod_id,
|
||||
ol.limit_unit AS ol_limit_unit,
|
||||
ol.max_orders AS ol_max_orders,
|
||||
</if>
|
||||
<!-- 只有当 weightSwitch 开启时,才查询体重区间价格相关字段 -->
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
tpe.is_weight_charge as tpe_is_weight_charge,
|
||||
wrp.id AS wrp_record_id,
|
||||
wrp.prod_id AS wrp_prod_id,
|
||||
wrp.weight_range AS wrp_weight_range,
|
||||
wrp.price AS wrp_price,
|
||||
wrp.is_enabled AS wrp_is_enabled,
|
||||
</if>
|
||||
<!-- 只有当 regionSwitch 开启时,才查询服务区域相关字段 -->
|
||||
<if test="regionSwitch != null and regionSwitch == 1">
|
||||
sa.id AS sa_rule_id,
|
||||
sa.prod_id AS sa_prod_id,
|
||||
sa.rule_type AS sa_rule_type,
|
||||
sa.fee AS sa_fee,
|
||||
saa.area_name AS sa_area_name,
|
||||
</if>
|
||||
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 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">
|
||||
LEFT JOIN tz_prod_additional_fee_periods afp ON p.prod_id = afp.prod_id AND afp.deleted = 0
|
||||
</if>
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
LEFT JOIN tz_prod_additional_fee_dates afd ON p.prod_id = afd.prod_id AND afd.deleted = 0 and afd.type = 1
|
||||
</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 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
|
||||
</if>
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
LEFT JOIN tz_prod_extend tpe ON p.prod_id = tpe.prod_id
|
||||
LEFT JOIN tz_prod_weight_range_prices wrp ON p.prod_id = wrp.prod_id AND wrp.deleted = 0
|
||||
</if>
|
||||
<if test="regionSwitch != null and regionSwitch == 1">
|
||||
LEFT JOIN tz_prod_service_over_area_rules sa ON p.prod_id = sa.prod_id AND sa.deleted = 0
|
||||
LEFT JOIN tz_prod_service_area_relevance sar ON p.prod_id = sar.prod_id
|
||||
LEFT JOIN tz_prod_service_areas saa ON sar.area_id = saa.id AND saa.deleted = 0
|
||||
</if>
|
||||
where p.deleted = 0
|
||||
AND p.prod_id = #{prodId}
|
||||
ORDER BY p.prod_id
|
||||
afp.id AS afp_record_id,
|
||||
afp.prod_id AS afp_prod_id,
|
||||
afp.name AS afp_name,
|
||||
afp.special_time_slots AS afp_special_time_slots,
|
||||
afp.charge_mode AS afp_charge_mode,
|
||||
afp.price AS afp_price,
|
||||
afp.floating_percentage AS afp_floating_percentage,
|
||||
|
||||
afd.id AS afd_record_id,
|
||||
afd.prod_id AS afd_prod_id,
|
||||
afd.name AS afd_name,
|
||||
afd.date_type AS afd_date_type,
|
||||
afd.custom_time_slots AS afd_custom_time_slots,
|
||||
afd.specific_dates AS afd_specific_dates,
|
||||
afd.charge_mode AS afd_charge_mode,
|
||||
afd.price AS afd_price,
|
||||
afd.is_enabled AS afd_is_enabled,
|
||||
afd.create_time AS afd_create_time,
|
||||
afd.update_time AS afd_update_time,
|
||||
afd.creator AS afd_creator,
|
||||
afd.updater AS afd_updater,
|
||||
afd.deleted AS afd_deleted,
|
||||
|
||||
rc.id AS rc_record_id,
|
||||
rc.prod_id AS rc_prod_id,
|
||||
rc.reservation_time_slots AS rc_reservation_time_slots,
|
||||
rc.advance_hours AS rc_advance_hours,
|
||||
rc.reservation_date_range AS rc_reservation_date_range,
|
||||
rc.allow_change AS rc_allow_change,
|
||||
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 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,
|
||||
|
||||
|
||||
ol.id AS ol_record_id,
|
||||
ol.prod_id AS ol_prod_id,
|
||||
ol.limit_unit AS ol_limit_unit,
|
||||
ol.max_orders AS ol_max_orders,
|
||||
|
||||
|
||||
tpe.is_weight_charge as tpe_is_weight_charge,
|
||||
wrp.id AS wrp_record_id,
|
||||
wrp.prod_id AS wrp_prod_id,
|
||||
wrp.weight_range AS wrp_weight_range,
|
||||
wrp.price AS wrp_price,
|
||||
wrp.is_enabled AS wrp_is_enabled,
|
||||
|
||||
|
||||
sa.id AS sa_rule_id,
|
||||
sa.prod_id AS sa_prod_id,
|
||||
sa.rule_type AS sa_rule_type,
|
||||
sa.fee AS sa_fee,
|
||||
saa.area_name AS sa_area_name,
|
||||
|
||||
p.prod_name
|
||||
FROM tz_prod p
|
||||
|
||||
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 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
|
||||
|
||||
LEFT JOIN tz_prod_additional_fee_periods afp ON p.prod_id = afp.prod_id AND afp.deleted = 0
|
||||
|
||||
LEFT JOIN tz_prod_additional_fee_dates afd
|
||||
ON p.prod_id = afd.prod_id AND afd.deleted = 0 and afd.type = 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 p.prod_id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
|
||||
|
||||
|
||||
LEFT JOIN tz_product_order_limit ol ON p.prod_id = ol.prod_id AND ol.deleted = 0
|
||||
|
||||
|
||||
LEFT JOIN tz_prod_extend tpe ON p.prod_id = tpe.prod_id
|
||||
LEFT JOIN tz_prod_weight_range_prices wrp ON p.prod_id = wrp.prod_id AND wrp.deleted = 0
|
||||
|
||||
|
||||
LEFT JOIN tz_prod_service_over_area_rules sa ON p.prod_id = sa.prod_id AND sa.deleted = 0
|
||||
LEFT JOIN tz_prod_service_area_relevance sar ON p.prod_id = sar.prod_id
|
||||
LEFT JOIN tz_prod_service_areas saa ON sar.area_id = saa.id AND saa.deleted = 0
|
||||
|
||||
where p.deleted = 0
|
||||
AND p.prod_id = #{prodId}
|
||||
ORDER BY p.prod_id ,rpafd.date_type ,epafd.date_type,afd.date_type ASC
|
||||
</select>
|
||||
|
||||
|
||||
@@ -416,8 +403,7 @@
|
||||
p.order_limit_switch,
|
||||
p.weight_switch,
|
||||
p.region_switch,
|
||||
<!-- 只有当 emergencySwitch 开启时,才查询紧急响应相关字段 -->
|
||||
<if test="emergencySwitch != null and emergencySwitch == 1">
|
||||
|
||||
erc.id AS erc_record_id,
|
||||
erc.response_time_slots as erc_response_time_slots,
|
||||
|
||||
@@ -429,7 +415,7 @@
|
||||
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.mode_name,
|
||||
eri.name as eri_name,
|
||||
eri.response_hours,
|
||||
eri.charge_mode,
|
||||
eri.floating_percentage,
|
||||
@@ -439,9 +425,8 @@
|
||||
eri.creator AS eri_creator,
|
||||
eri.updater AS eri_updater,
|
||||
eri.deleted AS eri_deleted,
|
||||
</if>
|
||||
<!-- 只有当 additionalFeeSwitch 开启时,才查询特殊日期规则相关字段 -->
|
||||
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
|
||||
|
||||
|
||||
afp.id AS afp_record_id,
|
||||
afp.prod_id AS afp_prod_id,
|
||||
afp.name AS afp_name,
|
||||
@@ -449,9 +434,8 @@
|
||||
afp.charge_mode AS afp_charge_mode,
|
||||
afp.price AS afp_price,
|
||||
afp.floating_percentage AS afp_floating_percentage,
|
||||
</if>
|
||||
<!-- 只有当 additionalSwitch 开启时,才查询特殊时段规则相关字段 -->
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
|
||||
|
||||
afd.id AS afd_record_id,
|
||||
afd.prod_id AS afd_prod_id,
|
||||
afd.name AS afd_name,
|
||||
@@ -466,9 +450,8 @@
|
||||
afd.creator AS afd_creator,
|
||||
afd.updater AS afd_updater,
|
||||
afd.deleted AS afd_deleted,
|
||||
</if>
|
||||
<!-- 只有当 reservationSwitch 开启时,才查询预约配置相关字段 -->
|
||||
<if test="reservationSwitch != null and reservationSwitch == 1">
|
||||
|
||||
|
||||
rc.id AS rc_record_id,
|
||||
rc.prod_id AS rc_prod_id,
|
||||
rc.reservation_time_slots AS rc_reservation_time_slots,
|
||||
@@ -484,49 +467,48 @@
|
||||
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">
|
||||
|
||||
|
||||
|
||||
ol.id AS ol_record_id,
|
||||
ol.prod_id AS ol_prod_id,
|
||||
ol.limit_unit AS ol_limit_unit,
|
||||
ol.max_orders AS ol_max_orders,
|
||||
</if>
|
||||
<!-- 只有当 weightSwitch 开启时,才查询体重区间价格相关字段 -->
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
|
||||
|
||||
tpe.is_weight_charge as tpe_is_weight_charge,
|
||||
wrp.id AS wrp_record_id,
|
||||
wrp.prod_id AS wrp_prod_id,
|
||||
wrp.weight_range AS wrp_weight_range,
|
||||
wrp.price AS wrp_price,
|
||||
wrp.is_enabled AS wrp_is_enabled,
|
||||
</if>
|
||||
|
||||
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 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">
|
||||
|
||||
|
||||
LEFT JOIN tz_prod_additional_fee_periods afp ON p.prod_id = afp.prod_id AND afp.deleted = 0
|
||||
</if>
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
LEFT JOIN tz_prod_additional_fee_dates afd ON p.prod_id = afd.prod_id AND afd.deleted = 0 afd.type = 1
|
||||
</if>
|
||||
<if test="reservationSwitch != null and reservationSwitch == 1">
|
||||
|
||||
|
||||
LEFT JOIN tz_prod_additional_fee_dates afd ON p.prod_id = afd.prod_id AND afd.deleted = 0 and afd.type = 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 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
|
||||
</if>
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
|
||||
|
||||
LEFT JOIN tz_prod_extend tpe ON p.prod_id = tpe.prod_id
|
||||
LEFT JOIN tz_prod_weight_range_prices wrp ON p.prod_id = wrp.prod_id AND wrp.deleted = 0
|
||||
</if>
|
||||
|
||||
where p.deleted = 0
|
||||
AND p.prod_id = #{prodId}
|
||||
ORDER BY p.prod_id
|
||||
|
||||
Reference in New Issue
Block a user