We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
因为前端时间范围组件,一般给的数据结构是个数组,["2024-06-01 00:00:00","2024-07-31 00:00:00"]
The text was updated successfully, but these errors were encountered:
我想了半天发现这个api可能并没有我一开始想的那么简单,首先如果你传入的是null怎么办,默认框架是不会进行过滤的这个时候range函数的处理和空数组处理还有数组内就一个元素的时候处理如果全部改成自适应那么相当于是违反了之前的方式,如果传入空或者null或者一个数组那么range前后又都是null就会和这个api相悖,所以我再三思考还是不打算增加这个api,您可以编写一个util
public static <TValue> TValue getIndexValueOrNull(TValue[] values,int index){ if(index<0){ throw new IllegalArgumentException("index < 0."); } if(EasyArrayUtil.isEmpty(values)){ return null; } if(values.length<=index){ return null; } return values[index]; } LocalDateTime[] times= new LocalDateTime[2]; List<Topic> list1 = easyEntityQuery.queryable(Topic.class) .where(t -> { t.createTime().rangeClosed(getIndexValueOrNull(times, 0), getIndexValueOrNull(times, 1)); }).toList();
Sorry, something went wrong.
No branches or pull requests
因为前端时间范围组件,一般给的数据结构是个数组,["2024-06-01 00:00:00","2024-07-31 00:00:00"]
The text was updated successfully, but these errors were encountered: