From 267cd7acf357e76e69eddd65eaca6d11e61a7a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sat, 14 Sep 2024 20:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BD=BF=E7=94=A8=E8=90=A5=E9=94=80=E7=9A=84=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=8C=83=E5=9B=B4=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/dal/mysql/reward/RewardActivityMapper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/reward/RewardActivityMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/reward/RewardActivityMapper.java index 51c076a25..06703a0f1 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/reward/RewardActivityMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/reward/RewardActivityMapper.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.promotion.controller.admin.reward.vo.RewardActivityPageReqVO; import cn.iocoder.yudao.module.promotion.dal.dataobject.reward.RewardActivityDO; +import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; @@ -65,9 +66,9 @@ public interface RewardActivityMapper extends BaseMapperX { .eq(RewardActivityDO::getStatus,status) .lt(RewardActivityDO::getStartTime, dateTime) .gt(RewardActivityDO::getEndTime, dateTime) - .and(i -> i. eq(RewardActivityDO::getProductScope, 2).and(i1 -> i1.apply(productScopeValuesFindInSetFunc.apply(spuIds)))) - .or(i -> i.eq(RewardActivityDO::getProductScope, 1)) - .or(i -> i. eq(RewardActivityDO::getProductScope, 3).and(i1 -> i1.apply(productScopeValuesFindInSetFunc.apply(categoryIds)))) + .and(i -> i. eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.SPU.getScope()).and(i1 -> i1.apply(productScopeValuesFindInSetFunc.apply(spuIds)))) + .or(i -> i.eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.ALL.getScope())) + .or(i -> i. eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.CATEGORY.getScope()).and(i1 -> i1.apply(productScopeValuesFindInSetFunc.apply(categoryIds)))) .orderByDesc(RewardActivityDO::getId) .last("limit 1") );