添加邮箱作为查询条件

This commit is contained in:
wuchunlei
2025-04-30 14:18:39 +08:00
parent d02026567a
commit 1ab791b093
4 changed files with 25 additions and 16 deletions

View File

@@ -360,7 +360,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
wrapper.gt(requestVo.getStartTime()!=null,BuyOrder::getCreateTime,requestVo.getStartTime());
wrapper.lt(requestVo.getEndTime()!=null,BuyOrder::getCreateTime,requestVo.getEndTime());
wrapper.orderByDesc(BuyOrder::getCreateTime);
wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()).or().like(BuyOrder::getShippingUser,requestVo.getSearchKeyWord()).or().like(BuyOrder::getUserPhone,requestVo.getSearchKeyWord()));
wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getEmail,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()).or().like(BuyOrder::getShippingUser,requestVo.getSearchKeyWord()).or().like(BuyOrder::getUserPhone,requestVo.getSearchKeyWord()));
if(StringUtils.isNotBlank(requestVo.getProductName())){
MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>();
buyOrderProductMPJLambdaWrapper.selectAll(BuyOrderProduct.class);

View File

@@ -1,5 +1,6 @@
package com.peanut.modules.book.service.impl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
import com.peanut.modules.common.entity.BookBuyConfigEntity;
import com.peanut.modules.common.entity.MyUserEntity;
@@ -27,9 +28,13 @@ public class PayPaymentOrderServiceImpl extends ServiceImpl<PayPaymentOrderDao,
public PageUtils queryPage(Map<String, Object> params) {
IPage<PayPaymentOrderEntity> page = this.page(
new Query<PayPaymentOrderEntity>().getPage(params),
new ExcludeEmptyQueryWrapper<PayPaymentOrderEntity>()
.eq("tel",params.get("key"))
.or().like("user_name",params.get("key")).orderByDesc("create_time")
new MPJLambdaWrapper<PayPaymentOrderEntity>()
.leftJoin(MyUserEntity.class,MyUserEntity::getId,PayPaymentOrderEntity::getId)
.selectAll(PayPaymentOrderEntity.class)
.and(t->t.like(MyUserEntity::getTel,params.get("key"))
.or().like(MyUserEntity::getEmail,params.get("key"))
.or().like("user_name",params.get("key")))
.orderByDesc("create_time")
);

View File

@@ -4,6 +4,7 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
@@ -31,14 +32,17 @@ public class TransactionDetailsServiceImpl extends ServiceImpl<TransactionDetail
@Override
public PageUtils queryPage(Map<String, Object> params) {
String userId = (String) params.get("userId");
IPage<TransactionDetailsEntity> page = this.page(
new Query<TransactionDetailsEntity>().getPage(params),
new ExcludeEmptyQueryWrapper<TransactionDetailsEntity>()
new MPJLambdaWrapper<TransactionDetailsEntity>()
.leftJoin(MyUserEntity.class,MyUserEntity::getId,TransactionDetailsEntity::getUserId)
.selectAll(TransactionDetailsEntity.class)
.eq(StringUtils.isNotBlank(userId),"user_id",userId)
.eq("tel",params.get("key")).or().like("user_name",params.get("key")).orderByDesc("create_time")
.and(t->t.like(MyUserEntity::getTel,params.get("key"))
.or().like(MyUserEntity::getEmail,params.get("key"))
.or().like("user_name",params.get("key")))
.orderByDesc("create_time")
);
return new PageUtils(page);
}