Feat:原生内置时间范围搜索

This commit is contained in:
wangyu 2021-01-10 21:42:12 +08:00
parent 7a2f8ca0ad
commit 1b160cea79

View File

@ -8,6 +8,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.util.StringUtils;
import java.util.Collection;
import java.util.List;
/**
* 基于名字模糊匹配的查询实体
@ -20,13 +21,9 @@ public class NameLikeQo<T extends Domain> extends BaseQo<T> {
protected String code;
protected String createTimeStart;
protected List<String> createTimeRange;
protected String createTimeEnd;
protected String modifyTimeStart;
protected String modifyTimeEnd;
protected List<String> modifyTimeRange;
protected String creatorId;
@ -55,10 +52,8 @@ public class NameLikeQo<T extends Domain> extends BaseQo<T> {
.with("enable", "code", "creatorId", "modifierId")
.with("ids", "id", CriteriaBuilder.Builders.IN)
.with("excludeId", "id", Criteria::ne)
.with("createTimeStart", "createTime", CriteriaBuilder.Builders.DATE_GTE)
.with("createTimeEnd", "createTime", CriteriaBuilder.Builders.DATE_LTE)
.with("modifyTimeStart", "modifyTime", CriteriaBuilder.Builders.DATE_GTE)
.with("modifyTimeEnd", "modifyTime", CriteriaBuilder.Builders.DATE_LTE);
.with("createTimeRange", "createTime", CriteriaBuilder.Builders.DATE_RANGE)
.with("modifyTimeRange", "modifyTime", CriteriaBuilder.Builders.DATE_RANGE);
}