feat:食堂菜品价格搜索
This commit is contained in:
1 parent
907a557c34
commit
0894e86d8c
2 files changed
+8
No files matched your search
+4
@@ -207,4 +207,8 @@ public class CanteenSpuEntity extends Model<CanteenSpuEntity> {
|
||||
|
||||
@Schema(description = "是否涨价")
|
||||
private String isPriceIncreased;
|
||||
|
||||
@Schema(description = "大于等于的价格")
|
||||
@TableField(exist = false)
|
||||
private Long gePrice;
|
||||
}
|
||||
+4
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.canteen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -228,6 +229,9 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
wrapper.like(StrUtil.isNotBlank(canteenSpu.getName()), CanteenSpuEntity::getName, canteenSpu.getName());
|
||||
wrapper.eq(Objects.nonNull(canteenSpu.getCategoryId()), CanteenSpuEntity::getCategoryId, canteenSpu.getCategoryId());
|
||||
wrapper.eq(Objects.nonNull(canteenSpu.getIsPriceIncreased()), CanteenSpuEntity::getIsPriceIncreased, canteenSpu.getIsPriceIncreased());
|
||||
if (ObjectUtil.isNotEmpty(canteenSpu.getGePrice()) && canteenSpu.getGePrice() > 0) {
|
||||
wrapper.ge(CanteenSpuEntity::getPrice, canteenSpu.getGePrice() * 100);
|
||||
}
|
||||
wrapper.orderByAsc(CanteenSpuEntity::getSort).orderByDesc(CanteenSpuEntity::getId);
|
||||
|
||||
LambdaQueryWrapper<CanteenOnlineSpuEntity> canteenOnlineSpuEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Reference in new issue
Block a user