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
SqlInterceptor
v3.1.x 版本 不直接支持 多字段排序,但可以通过 SQL 拦截器扩展实现该功能,如在 SpringBoot 项目中使用 bean-searcher-boot-starter 依赖时,只需要配置一个 Bean 就好:
@Bean public SqlInterceptor sqlInterceptor() { return new SqlInterceptor() { @Override public <T> SearchSql<T> intercept(SearchSql<T> searchSql, Map<String, Object> paraMap) { if (searchSql.isShouldQueryList()) { String listSql = searchSql.getListSqlString(); // TODO: 1、从 paraMap 中取出其它排序参数 // TODO: 2、对 listSql 的 order by 部分进行修改替换 // TODO: 3、再把修改后的 listSql 放进 searchSql searchSql.setListSqlString(listSql); } return searchSql; } }; }
The text was updated successfully, but these errors were encountered:
另 Bean Searcher v3.4 中已添加了对 多字段排序 的直接支持。 参见:https://bs.zhxu.cn/guide/latest/params.html#%E5%A4%9A%E5%AD%97%E6%AE%B5%E6%8E%92%E5%BA%8F%EF%BC%88since-v3-4-0%EF%BC%89
Sorry, something went wrong.
这个也还需要解析listSql这个字段串 , 来获取 order by 后面的内容,然后进行排序。可不可以提供对象修改的方式。
No branches or pull requests
v3.1.x 版本 不直接支持 多字段排序,但可以通过 SQL 拦截器扩展实现该功能,如在 SpringBoot 项目中使用 bean-searcher-boot-starter 依赖时,只需要配置一个 Bean 就好:
The text was updated successfully, but these errors were encountered: