企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、概述 约定一下,查询条件中,出现时间范围的,考虑到处理的一致性,统一用如下方式处理; ## 二、方案 ``` @ApiImplicitParam(name = "dateTimeScope", value = "查询条件-访问起止时间", allowMultiple = true, required = false, dataTypeClass = String.class, paramType = "query"), // ``` ``` @RequestParam(required = false) List<String> dateTimeScope, ``` 用列表的方式,前端通过数组传入起止时间;后台业务部分,提供统一方法判断两者的传入情况; ``` if (!StringUtil.isEmpty(getFirstDateTimePossible(dateTimeScope))) { predicates.add(criteriaBuilder.greaterThanOrEqualTo(root.get("loginTime"), getFirstDateTimePossible(dateTimeScope))); } if (!StringUtil.isEmpty(getSecondDateTimePossible(dateTimeScope))) { predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("loginTime"), getSecondDateTimePossible(dateTimeScope))); } ```