-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
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
为了适配索引需要对查询的参数有顺序的要求,能否在构建查询请求时按照构建参数的顺序最后生成where时按照构建顺序排序? #105
Comments
实际上,在索引命中与使用效率方面, |
感谢回复,是我描述不够严谨,这里我使用的数据库是Clickhouse,a是我的PARTITION分区键,在查询的时候我希望a能够在执行时在最前面。 |
当前版本,默认不支持,不过可以通过自定义 var params = MapUtils.builder(new LinkedHashMap<>())
// 添加参数...
.build();
// 执行查询 自定义 |
|
下个版本将优化为按 检索实体类 中字段声明的顺序生成条件,例如: public class UserVO {
private String name;
private int age;
} 当 这样,是否可以满足你的需求? |
|
父类的字段是更靠后 |
比如:
MapBuilder mapBuilder = MapUtils.builder();
mapBuilder.field(T::getA, "A").op(FieldOps.Equal);
mapBuilder.field(T::getB, "B").op(FieldOps.Equal);
生成的sql应该就是:
where a = 'a' and b = 'b'
The text was updated successfully, but these errors were encountered: