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 06703a0f1..5abbc9265 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 @@ -66,11 +66,12 @@ public interface RewardActivityMapper extends BaseMapperX { .eq(RewardActivityDO::getStatus,status) .lt(RewardActivityDO::getStartTime, dateTime) .gt(RewardActivityDO::getEndTime, dateTime) - .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)))) + .and(i -> i.eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.SPU.getScope()) + .and(i1 -> i1.apply(productScopeValuesFindInSetFunc.apply(spuIds))) + .or(i1 -> i1.eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.ALL.getScope())) + .or(i1 -> i1.eq(RewardActivityDO::getProductScope, PromotionProductScopeEnum.CATEGORY.getScope()) + .and(i2 -> i2.apply(productScopeValuesFindInSetFunc.apply(categoryIds))))) .orderByDesc(RewardActivityDO::getId) - .last("limit 1") ); }