QueryWrapper全部升级LambdaQueryWrapper

This commit is contained in:
LIONCITYS\lioncity
2020-10-16 14:51:38 +08:00
parent 15b9680209
commit 4c89f55a05
44 changed files with 242 additions and 243 deletions

View File

@ -34,7 +34,7 @@ import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -304,9 +304,9 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
@Override
public List<YxStoreBargainQueryVo> getList(int page, int limit) {
Page<YxStoreBargain> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargain> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
Date nowTime = new Date();
wrapper.lambda().eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
wrapper.eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.lt(YxStoreBargain::getStartTime,nowTime)
.gt(YxStoreBargain::getStopTime,nowTime);

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserHelpMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserHelpQueryVo;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -74,8 +74,8 @@ public class YxStoreBargainUserHelpServiceImpl extends BaseServiceImpl<YxStoreBa
return Collections.emptyList();
}
Page<YxStoreBargainUserHelp> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargainUserHelp> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
LambdaQueryWrapper<YxStoreBargainUserHelp> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
.orderByDesc(YxStoreBargainUserHelp::getId);
List<YxStoreBargainUserHelpQueryVo> storeBargainUserHelpQueryVos = generator
.convert(yxStoreBargainUserHelpMapper.selectPage(pageModel,wrapper).getRecords(),

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.activity.service.YxStoreBargainUserHelpService;
import co.yixiang.modules.activity.service.YxStoreBargainUserService;
import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -188,8 +188,8 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
*/
@Override
public YxStoreBargainUser getBargainUserInfo(Long bargainId, Long uid) {
QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUser::getBargainId,bargainId)
LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreBargainUser::getBargainId,bargainId)
.eq(YxStoreBargainUser::getUid,uid)
.last("limit 1");
return yxStoreBargainUserMapper.selectOne(wrapper);
@ -217,7 +217,7 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
// */
// @Override
// public List<YxStoreBargainUserQueryVo> getBargainUserList(int bargainId, int status) {
// QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>();
// LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq("bargain_id",bargainId).eq("status",status);
// return generator.convert(yxStoreBargainUserMapper.selectList(wrapper),
// YxStoreBargainUserQueryVo.class);

View File

@ -50,7 +50,7 @@ import co.yixiang.modules.template.domain.YxShippingTemplates;
import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -178,8 +178,8 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
CombinationQueryVo combinationQueryVo = new CombinationQueryVo();
Date nowTime = new Date();
Page<YxStoreCombination> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreCombination> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxStoreCombination> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxStoreCombination::getIsShow,1)
.le(YxStoreCombination::getStartTime,nowTime)
.ge(YxStoreCombination::getStopTime,nowTime)
@ -208,15 +208,15 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class);
for (YxStoreCombinationDto combinationDTO : combinationDTOS) {
//参与人数
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda()
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId())));
//成团人数
combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda()
combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId())
.eq(YxStorePink::getKId,0)));//团长
//获取查看拼团产品人数
combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new QueryWrapper<YxStoreVisit>().lambda()
combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new LambdaQueryWrapper<YxStoreVisit>()
.eq(YxStoreVisit::getProductId,combinationDTO.getId())
.eq(YxStoreVisit::getProductType,"combination")));
}

View File

@ -31,7 +31,7 @@ import co.yixiang.modules.cart.vo.YxStoreCartQueryVo;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -264,8 +264,8 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
*/
private void checkInvalidCoupon() {
Date nowTime = new Date();
QueryWrapper<YxStoreCouponUser> wrapper= new QueryWrapper<>();
wrapper.lambda().lt(YxStoreCouponUser::getEndTime,nowTime)
LambdaQueryWrapper<YxStoreCouponUser> wrapper= new LambdaQueryWrapper<>();
wrapper.lt(YxStoreCouponUser::getEndTime,nowTime)
.eq(YxStoreCouponUser::getStatus,CouponEnum.STATUS_0.getValue());
YxStoreCouponUser couponUser = new YxStoreCouponUser();
couponUser.setStatus(CouponEnum.STATUS_2.getValue());
@ -284,7 +284,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
PageInfo<YxStoreCouponUser> page = new PageInfo<>(queryAll(criteria));
List<YxStoreCouponUserDto> storeOrderDTOS = generator.convert(page.getList(),YxStoreCouponUserDto.class);
for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) {
couponUserDTO.setNickname(userService.getOne(new QueryWrapper<YxUser>().lambda()
couponUserDTO.setNickname(userService.getOne(new LambdaQueryWrapper<YxUser>()
.eq(YxUser::getUid,couponUserDTO.getUid())).getNickname());
}
Map<String,Object> map = new LinkedHashMap<>(2);

View File

@ -43,7 +43,6 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -135,7 +134,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
//把团长下个人设置为团长
if(ObjectUtil.isNotNull(nextPinkT)){
QueryWrapper<YxStorePink> wrapperO = new QueryWrapper<>();
LambdaQueryWrapper<YxStorePink> wrapperO = new LambdaQueryWrapper<>();
YxStorePink storePinkO = new YxStorePink();
storePinkO.setKId(0L); //设置团长
storePinkO.setStatus(OrderInfoEnum.PINK_STATUS_1.getValue());
@ -144,7 +143,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
yxStorePinkMapper.updateById(storePinkO);
//原有团长的数据变更成新团长下面
wrapperO.lambda().eq(YxStorePink::getKId,pinkT.getId());
wrapperO.eq(YxStorePink::getKId,pinkT.getId());
YxStorePink storePinkT = new YxStorePink();
storePinkT.setKId(nextPinkT.getId());
yxStorePinkMapper.update(storePinkT,wrapperO);
@ -519,8 +518,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
int pinkBool = PinkEnum.PINK_BOOL_0.getValue();
if(pinkStatus){
//更改状态
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>();
wrapper.lambda().in(YxStorePink::getId,idAll);
LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.in(YxStorePink::getId,idAll);
YxStorePink storePink = new YxStorePink();
storePink.setStopTime(new Date());
@ -546,14 +545,14 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
*/
private void orderPinkFailAfter(Long uid, Long pid) {
YxStorePink yxStorePink = new YxStorePink();
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getId,pid);
LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStorePink::getId,pid);
yxStorePink.setStatus(OrderInfoEnum.PINK_STATUS_3.getValue());
yxStorePink.setStopTime(new Date());
yxStorePinkMapper.update(yxStorePink,wrapper);
QueryWrapper<YxStorePink> wrapperT = new QueryWrapper<>();
wrapperT.lambda().eq(YxStorePink::getKId,pid);
LambdaQueryWrapper<YxStorePink> wrapperT = new LambdaQueryWrapper<>();
wrapperT.eq(YxStorePink::getKId,pid);
yxStorePinkMapper.update(yxStorePink,wrapperT);
//todo 模板消息
}
@ -625,8 +624,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
* @return int
*/
private int getPinkPeople(Long kid, int people) {
QueryWrapper<YxStorePink> wrapper= new QueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getKId,kid)
LambdaQueryWrapper<YxStorePink> wrapper= new LambdaQueryWrapper<>();
wrapper.eq(YxStorePink::getKId,kid)
.eq(YxStorePink::getIsRefund, OrderInfoEnum.PINK_REFUND_STATUS_0.getValue());
//加上团长自己
int count = yxStorePinkMapper.selectCount(wrapper) + 1;

View File

@ -41,7 +41,7 @@ import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -82,7 +82,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
// @Override
// public YxStoreSeckill getSeckill(int id) {
// QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
// LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
// int nowTime = OrderUtil.getSecondTimestampTwo();
// wrapper.eq("id",id).eq("is_del",0).eq("status",1)
// .le("start_time",nowTime).ge("stop_time",nowTime);
@ -145,8 +145,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit, int time) {
Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getTimeId,time)
.le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime)
@ -171,8 +171,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit) {
Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getIsHot,1)
.le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime)

View File

@ -229,7 +229,7 @@ public class YxUserExtractServiceImpl extends BaseServiceImpl<YxUserExtractMappe
/**
boolean isTest = true;
if(!isTest){
YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class);
YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new LambdaQueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class);
if(ObjectUtil.isNotNull(wechatUser)){
try {
payService.entPay(wechatUser.getOpenid(),resources.getId().toString(),

View File

@ -42,7 +42,7 @@ import co.yixiang.modules.product.service.YxStoreProductService;
import co.yixiang.modules.product.vo.YxStoreProductQueryVo;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -163,15 +163,15 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
*/
@Override
public Map<String, Object> getUserProductCartList(Long uid, String cartIds, Integer status) {
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid)
LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.orderByDesc(YxStoreCart::getId);
if (status == null) {
wrapper.lambda().eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue());
wrapper.eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue());
}
if (StrUtil.isNotEmpty(cartIds)) {
wrapper.lambda().in(YxStoreCart::getId, Arrays.asList(cartIds.split(",")));
wrapper.in(YxStoreCart::getId, Arrays.asList(cartIds.split(",")));
}
List<YxStoreCart> carts = yxStoreCartMapper.selectList(wrapper);
@ -284,8 +284,8 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
Integer isNew, Long combinationId, Long seckillId, Long bargainId) {
this.checkProductStock(uid, productId, cartNum, productAttrUnique, combinationId, seckillId, bargainId);
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid)
LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreCart::getProductId, productId)
.eq(YxStoreCart::getIsNew, isNew)

View File

@ -20,7 +20,7 @@ import co.yixiang.modules.category.service.mapper.StoreCategoryMapper;
import co.yixiang.utils.CateDTO;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.TreeUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
@ -59,8 +59,8 @@ public class YxStoreCategoryServiceImpl extends BaseServiceImpl<StoreCategoryMap
*/
@Override
public List<CateDTO> getList() {
QueryWrapper<YxStoreCategory> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByAsc(YxStoreCategory::getSort);
List<CateDTO> list = generator.convert(baseMapper.selectList(wrapper),CateDTO.class);
return TreeUtil.list2TreeConverter(list,0);

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.order.service.dto.YxStoreOrderCartInfoQueryCriteria;
import co.yixiang.modules.order.service.mapper.StoreOrderCartInfoMapper;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -47,8 +47,8 @@ public class YxStoreOrderCartInfoServiceImpl extends BaseServiceImpl<StoreOrderC
@Override
public YxStoreOrderCartInfo findByUni(String unique) {
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>();
wrapper.eq("`unique`",unique);
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrderCartInfo::getUnique,unique);
return this.baseMapper.selectOne(wrapper);
}

View File

@ -97,7 +97,6 @@ import co.yixiang.utils.RedisUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -1035,49 +1034,49 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public List<YxStoreOrderQueryVo> orderList(Long uid, int type, int page, int limit) {
QueryWrapper<YxStoreOrder> wrapper= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapper= new LambdaQueryWrapper<>();
if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid);
wrapper.eq(YxStoreOrder::getUid,uid);
}
wrapper.lambda().orderByDesc(YxStoreOrder::getId);
wrapper.orderByDesc(YxStoreOrder::getId);
switch (OrderStatusEnum.toType(type)){
case STATUS_0://未支付
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break;
case STATUS_1://待发货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break;
case STATUS_2://待收货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
break;
case STATUS_3://待评价
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
break;
case STATUS_4://已完成
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
break;
case STATUS_MINUS_1://退款中
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_1.getValue());
break;
case STATUS_MINUS_2://已退款
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_2.getValue());
break;
case STATUS_MINUS_3://退款
String[] strs = {"1","2"};
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus, Arrays.asList(strs));
break;
}
@ -1110,7 +1109,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
.beginOfMonth(new Date()));
double price = 0d;
List<ChartDataDto> list = null;
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("paid",1).eq("refund_status",0).eq("is_del",0);
switch (OrderCountEnum.toType(cate)){
@ -1157,8 +1156,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo();
//今日成交额
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>();
wrapperOne.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
wrapperOne
.ge(YxStoreOrder::getPayTime,today)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1167,8 +1166,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setTodayCount(yxStoreOrderMapper.selectCount(wrapperOne));
//昨日成交额
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>();
wrapperTwo.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
wrapperTwo
.lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,yesterday)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1178,8 +1177,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setProCount(yxStoreOrderMapper.selectCount(wrapperTwo));
//本月成交额
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>();
wrapperThree.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
wrapperThree
.ge(YxStoreOrder::getPayTime,nowMonth)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1188,8 +1187,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree));
//上周成交额
QueryWrapper<YxStoreOrder> wrapperLastWeek = new QueryWrapper<>();
wrapperLastWeek.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperLastWeek = new LambdaQueryWrapper<>();
wrapperLastWeek
.lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,lastWeek)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1223,11 +1222,11 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
public UserOrderCountVo orderData(Long uid) {
//订单支付没有退款 数量
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperOne.lambda().eq(YxStoreOrder::getUid,uid);
wrapperOne.eq(YxStoreOrder::getUid,uid);
}
wrapperOne.lambda().eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
wrapperOne.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue());
Integer orderCount = yxStoreOrderMapper.selectCount(wrapperOne);
@ -1235,62 +1234,62 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
double sumPrice = yxStoreOrderMapper.sumPrice(uid);
//订单待支付 数量
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperTwo.lambda().eq(YxStoreOrder::getUid,uid);
wrapperTwo.eq(YxStoreOrder::getUid,uid);
}
wrapperTwo.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
wrapperTwo.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unpaidCount = yxStoreOrderMapper.selectCount(wrapperTwo);
//订单待发货 数量
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperThree.lambda().eq(YxStoreOrder::getUid,uid);
wrapperThree.eq(YxStoreOrder::getUid,uid);
}
wrapperThree.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperThree.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree);
//订单待收货 数量
QueryWrapper<YxStoreOrder> wrapperFour = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperFour = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperFour.lambda().eq(YxStoreOrder::getUid,uid);
wrapperFour.eq(YxStoreOrder::getUid,uid);
}
wrapperFour.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperFour.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
Integer receivedCount = yxStoreOrderMapper.selectCount(wrapperFour);
//订单待评价 数量
QueryWrapper<YxStoreOrder> wrapperFive = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperFive = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperFive.lambda().eq(YxStoreOrder::getUid,uid);
wrapperFive.eq(YxStoreOrder::getUid,uid);
}
wrapperFive.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperFive.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
Integer evaluatedCount = yxStoreOrderMapper.selectCount(wrapperFive);
//订单已完成 数量
QueryWrapper<YxStoreOrder> wrapperSix= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperSix= new LambdaQueryWrapper<>();
if(uid != null) {
wrapperSix.lambda().eq(YxStoreOrder::getUid,uid);
wrapperSix.eq(YxStoreOrder::getUid,uid);
}
wrapperSix.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperSix.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
Integer completeCount = yxStoreOrderMapper.selectCount(wrapperSix);
//订单退款
QueryWrapper<YxStoreOrder> wrapperSeven= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperSeven= new LambdaQueryWrapper<>();
if(uid != null) {
wrapperSeven.lambda().eq(YxStoreOrder::getUid,uid);
wrapperSeven.eq(YxStoreOrder::getUid,uid);
}
String[] strArr = {"1","2"};
wrapperSeven.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperSeven.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus,Arrays.asList(strArr));
Integer refundCount = yxStoreOrderMapper.selectCount(wrapperSeven);
@ -1314,8 +1313,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order) {
QueryWrapper<YxStoreOrderCartInfo> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreOrderCartInfo::getOid,order.getId());
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrderCartInfo::getOid,order.getId());
List<YxStoreOrderCartInfo> cartInfos = orderCartInfoService.list(wrapper);
List<YxStoreCartQueryVo> cartInfo = cartInfos.stream()
@ -1414,8 +1413,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,null);
//更新订单状态
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreOrder::getOrderId,orderId);
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrder::getOrderId,orderId);
YxStoreOrder storeOrder = new YxStoreOrder();
storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
storeOrder.setPayType(payType);
@ -1535,12 +1534,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public YxStoreOrderQueryVo getOrderInfo(String unique,Long uid) {
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
wrapper.lambda().and(
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.and(
i->i.eq(YxStoreOrder::getOrderId,unique).or().eq(YxStoreOrder::getUnique,unique).or()
.eq(YxStoreOrder::getExtendOrderId,unique));
if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid);
wrapper.eq(YxStoreOrder::getUid,uid);
}
return generator.convert(yxStoreOrderMapper.selectOne(wrapper),YxStoreOrderQueryVo.class);
@ -1667,8 +1666,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|| OrderStatusEnum.STATUS_MINUS_2.getValue().equals(order.getStatus())){
return;
}
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>();
wrapper.lambda().in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(",")));
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(",")));
List<YxStoreOrderCartInfo> cartInfoList = orderCartInfoService.list(wrapper);
for (YxStoreOrderCartInfo cartInfo : cartInfoList) {
@ -2107,7 +2106,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Transactional(rollbackFor = Exception.class)
public void update(YxStoreOrder resources) {
YxStoreOrder yxStoreOrder = this.getById(resources.getId());
YxStoreOrder yxStoreOrder1 = this.getOne(new QueryWrapper<YxStoreOrder>().lambda()
YxStoreOrder yxStoreOrder1 = this.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getUnique,resources.getUnique()));
if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){
throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique());
@ -2228,7 +2227,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrderDto.setStoreOrderStatusList(orderStatusDtos);
//添加购物车详情
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2247,7 +2246,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Override
public Map<String, Object> queryAll(List<String> ids) {
List<YxStoreOrder> yxStoreOrders = this.list(new QueryWrapper<YxStoreOrder>().in("order_id",ids));
List<YxStoreOrder> yxStoreOrders = this.list(new LambdaQueryWrapper<YxStoreOrder>().in(YxStoreOrder::getOrderId,ids));
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
for (YxStoreOrder yxStoreOrder :yxStoreOrders) {
this.orderList(storeOrderDTOS, yxStoreOrder);
@ -2303,7 +2302,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrder.getShippingType()));
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2336,7 +2335,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
Long bargainId,Integer shippingType) {
String str = "[普通订单]";
if(pinkId > 0 || combinationId > 0){
YxStorePink storePink = storePinkService.getOne(new QueryWrapper<YxStorePink>().lambda()
YxStorePink storePink = storePinkService.getOne(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getOrderIdKey,id));
if(ObjectUtil.isNull(storePink)) {
str = "[拼团订单]";

View File

@ -27,7 +27,7 @@ import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -186,8 +186,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override
public int getInfoCount(Integer oid, String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.eq("`unique`",unique).eq("oid",oid);
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getUnique,unique).eq(YxStoreProductReply::getOid,oid);
return this.baseMapper.selectCount(wrapper);
}
@ -201,8 +201,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override
public int replyCount(String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.eq("`unique`",unique);
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getUnique,unique);
return this.baseMapper.selectCount(wrapper);
}
@ -213,8 +213,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
*/
@Override
public String replyPer(long productId) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProductReply::getProductId,productId)
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getProductId,productId)
.eq(YxStoreProductReply::getIsDel,ShopCommonEnum.DELETE_0.getValue())
.eq(YxStoreProductReply::getProductScore,5);
int productScoreCount = this.baseMapper.selectCount(wrapper);

View File

@ -171,8 +171,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public YxStoreProduct getProductInfo(int id) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.eq("is_del", 0).eq("is_show", 1).eq("id", id);
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, 1).eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = this.baseMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) {
throw new ErrorRequestException("商品不存在或已下架");
@ -230,7 +230,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue());
//多字段模糊查询分类搜索
@ -296,8 +296,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
*/
@Override
public ProductVo goodsDetail(Long id, Long uid, String latitude, String longitude) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = storeProductMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) {
@ -402,26 +402,26 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public List<YxStoreProductQueryVo> getList(int page, int limit, int order) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxStoreProduct::getSort);
// order
switch (ProductEnum.toType(order)) {
case TYPE_1:
wrapper.lambda().eq(YxStoreProduct::getIsBest,
wrapper.eq(YxStoreProduct::getIsBest,
ShopCommonEnum.IS_STATUS_1.getValue()); //精品推荐
break;
case TYPE_3:
wrapper.lambda().eq(YxStoreProduct::getIsNew,
wrapper.eq(YxStoreProduct::getIsNew,
ShopCommonEnum.IS_STATUS_1.getValue());//// 首发新品
break;
case TYPE_4:
wrapper.lambda().eq(YxStoreProduct::getIsBenefit,
wrapper.eq(YxStoreProduct::getIsBenefit,
ShopCommonEnum.IS_STATUS_1.getValue()); //// 猜你喜欢
break;
case TYPE_2:
wrapper.lambda().eq(YxStoreProduct::getIsHot,
wrapper.eq(YxStoreProduct::getIsHot,
ShopCommonEnum.IS_STATUS_1.getValue());//// 热门榜单
break;
}

View File

@ -13,7 +13,7 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.domain.YxSystemAttachment;
import co.yixiang.modules.shop.service.YxSystemAttachmentService;
import co.yixiang.modules.shop.service.mapper.YxSystemAttachmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -43,8 +43,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/
@Override
public YxSystemAttachment getInfo(String name) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getName,name)
LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemAttachment::getName,name)
.last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper);
}
@ -56,8 +56,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/
@Override
public YxSystemAttachment getByCode(String code) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getInviteCode,code)
LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemAttachment::getInviteCode,code)
.last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper);
}

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.modules.shop.service.mapper.SystemConfigMapper;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -59,8 +59,8 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
return result;
}
QueryWrapper<YxSystemConfig> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemConfig::getMenuName,name);
LambdaQueryWrapper<YxSystemConfig> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemConfig::getMenuName,name);
YxSystemConfig systemConfig = this.baseMapper.selectOne(wrapper);
if(systemConfig == null) {
return "";
@ -103,7 +103,7 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
@Override
public YxSystemConfig findByKey(String key) {
return this.getOne(new QueryWrapper<YxSystemConfig>().lambda()
return this.getOne(new LambdaQueryWrapper<YxSystemConfig>()
.eq(YxSystemConfig::getMenuName,key));
}
}

View File

@ -29,7 +29,7 @@ import co.yixiang.modules.user.service.mapper.UserBillMapper;
import co.yixiang.modules.user.service.mapper.YxUserTaskFinishMapper;
import co.yixiang.modules.user.vo.YxSystemUserTaskQueryVo;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -112,8 +112,8 @@ public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<SystemUserTaskM
*/
@Override
public TaskDto getTaskList(int levelId, Long uid) {
QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemUserTask::getLevelId,levelId)
LambdaQueryWrapper<YxSystemUserTask> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemUserTask::getLevelId,levelId)
.eq(YxSystemUserTask::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxSystemUserTask::getSort);
List<YxSystemUserTaskQueryVo> list = generator.convert(yxSystemUserTaskMapper

View File

@ -20,7 +20,6 @@ import co.yixiang.modules.user.service.YxUserAddressService;
import co.yixiang.modules.user.service.mapper.YxUserAddressMapper;
import co.yixiang.modules.user.vo.YxUserAddressQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
@ -58,7 +57,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
yxUserAddressMapper.update(address,
new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid));
new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
YxUserAddress userAddress = new YxUserAddress();
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_1.getValue());
@ -90,7 +89,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
//新增地址如果是默认,把之前的状态改掉
YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
baseMapper.update(address,new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid));
baseMapper.update(address,new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
}else{
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
}
@ -136,8 +135,8 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
*/
@Override
public YxUserAddress getUserDefaultAddress(Long uid) {
QueryWrapper<YxUserAddress> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserAddress::getIsDefault,1).
LambdaQueryWrapper<YxUserAddress> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserAddress::getIsDefault,1).
eq(YxUserAddress::getUid,uid)
.last("limit 1");
return getOne(wrapper);

View File

@ -26,7 +26,7 @@ import co.yixiang.modules.user.vo.YxUserBillQueryVo;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -124,9 +124,9 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public int cumulativeAttendance(Long uid) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.eq("uid",uid).eq("category","integral")
.eq("type","sign").eq("pm",1);
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserBill::getUid,uid).eq(YxUserBill::getCategory,"integral")
.eq(YxUserBill::getType,"sign").eq(YxUserBill::getPm,1);
return yxUserBillMapper.selectCount(wrapper);
}
@ -139,11 +139,11 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public Map<String, Object> spreadOrder(Long uid, int page, int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda().in(YxUserBill::getUid, uid)
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.in(YxUserBill::getUid, uid)
.eq(YxUserBill::getType, BillDetailEnum.TYPE_2.getValue())
.eq(YxUserBill::getCategory, BillDetailEnum.CATEGORY_1.getValue());
wrapper.orderByDesc("time").groupBy("time");
wrapper.orderByDesc(YxUserBill::getCreateTime).groupBy(YxUserBill::getCreateTime);
Page<YxUserBill> pageModel = new Page<>(page, limit);
List<String> list = yxUserBillMapper.getBillOrderList(wrapper, pageModel);
@ -180,39 +180,39 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public List<BillVo> getUserBillList(int page, int limit, long uid, int type) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId);
wrapper.groupBy("time");
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId);
wrapper.groupBy(YxUserBill::getCreateTime);
switch (BillInfoEnum.toType(type)){
case PAY_PRODUCT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue());
break;
case RECHAREGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue());
break;
case BROKERAGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue());
break;
case EXTRACT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue());
break;
case SIGN_INTEGRAL:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue());
break;
default:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
}
Page<YxUserBill> pageModel = new Page<>(page, limit);
List<BillVo> billDTOList = yxUserBillMapper.getBillList(wrapper,pageModel);
for (BillVo billDTO : billDTOList) {
QueryWrapper<YxUserBill> wrapperT = new QueryWrapper<>();
wrapperT.lambda().in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(",")));
LambdaQueryWrapper<YxUserBill> wrapperT = new LambdaQueryWrapper<>();
wrapperT.in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(",")));
billDTO.setList(yxUserBillMapper.getUserBillList(wrapperT));
}
@ -245,8 +245,8 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public List<YxUserBillQueryVo> userBillList(Long uid,String category,int page,int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxUserBill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserBill::getUid,uid)
.eq(YxUserBill::getCategory,category)

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.service.mapper.SystemUserTaskMapper;
import co.yixiang.modules.user.service.mapper.YxUserLevelMapper;
import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -92,13 +92,13 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
*/
@Override
public YxUserLevel getUserLevel(Long uid, Integer grade) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade);
if(grade != null) {
wrapper.lambda().lt(YxUserLevel::getGrade,grade);
wrapper.lt(YxUserLevel::getGrade,grade);
}
YxUserLevel userLevel = this.getOne(wrapper,false);
if(ObjectUtil.isNull(userLevel)) {
@ -133,8 +133,8 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
int validTime = systemUserLevelQueryVo.getValidDate() * 86400;
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.eq(YxUserLevel::getLevelId,levelId)
.last("limit 1");

View File

@ -46,7 +46,7 @@ import co.yixiang.modules.user.service.mapper.UserMapper;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -356,8 +356,8 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
*/
@Override
public double setLevelPrice(double price, long uid) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade)
.last("limit 1");