字段错误
This commit is contained in:
parent
3792b20748
commit
e239ecf6d7
|
|
@ -52,7 +52,9 @@ public class MkLimitTimeDiscountServiceImpl extends ServiceImpl<MkLimitTimeDisco
|
|||
q.eq(MkLimitTimeDiscount::getUseShopType, "all").or(q1 -> {
|
||||
q1.eq(MkLimitTimeDiscount::getUseShopType, "only").eq(MkLimitTimeDiscount::getShopId, shopId);
|
||||
}).or(q2 -> {
|
||||
q2.eq(MkLimitTimeDiscount::getUseShopType, "custom").gt("FIND_IN_SET(" + shopId + ", use_shops)", 0);
|
||||
q2.eq(MkLimitTimeDiscount::getUseShopType, "custom").and(q3 -> {
|
||||
q3.eq(MkLimitTimeDiscount::getShopId, shopId).or("FIND_IN_SET( " + shopId + ", use_shops ) > 0");
|
||||
});
|
||||
});
|
||||
});
|
||||
return pageAs(PageUtil.buildPage(), queryWrapper, MkLimitTimeDiscountDTO.class);
|
||||
|
|
@ -152,10 +154,12 @@ public class MkLimitTimeDiscountServiceImpl extends ServiceImpl<MkLimitTimeDisco
|
|||
.orderBy(MkLimitTimeDiscount::getUpdateTime).desc();
|
||||
|
||||
queryWrapper.and(q -> {
|
||||
q.eq(MkLimitTimeDiscount::getUseType, "all").or(q1 -> {
|
||||
q1.eq(MkLimitTimeDiscount::getUseType, "only").eq(MkLimitTimeDiscount::getShopId, 999);
|
||||
q.eq(MkLimitTimeDiscount::getUseShopType, "all").or(q1 -> {
|
||||
q1.eq(MkLimitTimeDiscount::getUseShopType, "only").eq(MkLimitTimeDiscount::getShopId, 3);
|
||||
}).or(q2 -> {
|
||||
q2.eq(MkLimitTimeDiscount::getUseType, "custom").gt("FIND_IN_SET(" + 2 + ", use_shops)", 0);
|
||||
q2.eq(MkLimitTimeDiscount::getUseShopType, "custom").and(q3 -> {
|
||||
q3.eq(MkLimitTimeDiscount::getShopId, 3).or("FIND_IN_SET( " + 3 + ", use_shops ) > 0");
|
||||
});
|
||||
});
|
||||
});
|
||||
System.out.println(queryWrapper.toSQL());
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
AND (
|
||||
(use_shop_type = 'all')
|
||||
OR (use_shop_type = 'only' AND #{shopId} = shop_id)
|
||||
OR (use_shop_type = 'custom' AND FIND_IN_SET(#{shopId}, use_shops) > 0)
|
||||
OR (use_shop_type = 'custom' AND (shop_id = #{shopId} OR ( FIND_IN_SET( #{shopId}, use_shops ) > 0 ))))
|
||||
)
|
||||
AND is_del = 0
|
||||
AND status = 2
|
||||
|
|
|
|||
Loading…
Reference in New Issue