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);