From d7f499378dafe6e19aada84c847abcf57bcbac54 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Mon, 4 Nov 2024 19:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cultural/heritage/service/order/impl/OrderServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/cultural/heritage/service/order/impl/OrderServiceImpl.java b/src/main/java/com/cultural/heritage/service/order/impl/OrderServiceImpl.java index cb3de41..95d69fc 100644 --- a/src/main/java/com/cultural/heritage/service/order/impl/OrderServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/order/impl/OrderServiceImpl.java @@ -37,13 +37,12 @@ public class OrderServiceImpl extends ServiceImpl implements Date endTime = orderQueryRequest.getEndTime(); String sortOrder = orderQueryRequest.getSortOrder(); String sortField = orderQueryRequest.getSortField(); - QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(ObjectUtils.isNotEmpty(userId), "userId", userId); queryWrapper.ge(ObjectUtils.isNotEmpty(minTotalAmount), "totalAmount", minTotalAmount); queryWrapper.le(ObjectUtils.isNotEmpty(maxTotalAmount), "totalAmount", maxTotalAmount); queryWrapper.eq(StringUtils.isNotBlank(orderStatus), "orderStatus", orderStatus); - queryWrapper.between("createTime", startTime, endTime); + queryWrapper.between(startTime != null && endTime != null, "createTime", startTime, endTime); queryWrapper.eq(StringUtils.isNotBlank(orderNumber), "orderNumber", orderNumber); queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC), sortField);