Просмотр исходного кода

个微池进粉详情支持时间查询

lqc 5 лет назад
Родитель
Сommit
4c7cd09cbf

+ 4 - 0
src/main/java/com/mokamrp/privates/entity/pangu/FosterwxFlowListHandle.java

@@ -3,9 +3,13 @@ package com.mokamrp.privates.entity.pangu;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 
+import java.time.LocalDate;
+
 @Data
 public class FosterwxFlowListHandle extends Model<FosterwxFlowListHandle> {
     private Integer page;
     private Integer pageSize;
     private String poolIndex;
+    private LocalDate timeFrom;
+    private LocalDate timeTo;
 }

+ 10 - 0
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxFlowListServiceImpl.java

@@ -10,6 +10,8 @@ import com.mokamrp.privates.service.pangu.FosterwxFlowListService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -39,6 +41,14 @@ public class FosterwxFlowListServiceImpl extends ServiceImpl<FosterwxFlowListMap
         Page<FosterwxFlowList> pageObj = new Page<FosterwxFlowList>(page, pageSize);
         LambdaQueryWrapper<FosterwxFlowList> fosterwxFlowListLambdaQueryWrapper = new LambdaQueryWrapper<>();
         fosterwxFlowListLambdaQueryWrapper.eq(FosterwxFlowList::getPoolId, handle.getPoolIndex());
+        if (null != handle.getTimeFrom()) {
+            fosterwxFlowListLambdaQueryWrapper.ge(FosterwxFlowList::getCreateAt, LocalDateTime.of(handle.getTimeFrom(), LocalTime.MIN));
+        }
+        if (null != handle.getTimeTo()) {
+            fosterwxFlowListLambdaQueryWrapper.le(FosterwxFlowList::getCreateAt, LocalDateTime.of(handle.getTimeTo(), LocalTime.MAX));
+        }
+
+        fosterwxFlowListLambdaQueryWrapper.orderByDesc(FosterwxFlowList::getId);
         pageObj = fosterwxFlowListMapper.selectPage(pageObj, fosterwxFlowListLambdaQueryWrapper);
         Map<String, Object> resMap = new HashMap<String, Object>();
         resMap.put("list", pageObj.getRecords());