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
当前最新版(3.6.1)
前端传过来的column 如果是有多个 比如“id,createTime” 只能有一个顺序 多个顺序不支持
https://github.com/jeecgboot/jeecg-boot/blob/master/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java里 283行
//有多个order且有多个顺序 if (column.contains(",") && order.contains(",")) { String[] columnArray = column.split(","); String[] orderArray = order.split(","); for (int i = 0; i < columnArray.length; i++) { String columnStr = oConvertUtils.camelToUnderline(columnArray[i]); if (i<orderArray.length){ //有一一对应的升序或降序 if (orderArray[i].toUpperCase().indexOf(ORDER_TYPE_ASC) >= 0) { queryWrapper.orderByAsc(columnStr); }else { queryWrapper.orderByDesc(columnStr); } }else{ //没有设定,默认为降序 queryWrapper.orderByDesc(columnStr); } } } else { //update-begin--Author:scott Date:20210531 for:36 多条件排序无效问题修正------- // 排序规则修改 // 将现有排序 _ 前端传递排序条件{....,column: 'column1,column2',order: 'desc'} 翻译成sql "column1,column2 desc" // 修改为 _ 前端传递排序条件{....,column: 'column1,column2',order: 'desc'} 翻译成sql "column1 desc,column2 desc" if (order.toUpperCase().indexOf(ORDER_TYPE_ASC) >= 0) { //queryWrapper.orderByAsc(oConvertUtils.camelToUnderline(column)); String columnStr = oConvertUtils.camelToUnderline(column); String[] columnArray = columnStr.split(","); queryWrapper.orderByAsc(Arrays.asList(columnArray)); } else { //queryWrapper.orderByDesc(oConvertUtils.camelToUnderline(column)); String columnStr = oConvertUtils.camelToUnderline(column); String[] columnArray = columnStr.split(","); queryWrapper.orderByDesc(Arrays.asList(columnArray)); } //update-end--Author:scott Date:20210531 for:36 多条件排序无效问题修正------- }
The text was updated successfully, but these errors were encountered:
暂时收录到 “新需求汇总” #1312
Sorry, something went wrong.
No branches or pull requests
版本号:
当前最新版(3.6.1)
问题描述:
前端传过来的column 如果是有多个 比如“id,createTime” 只能有一个顺序 多个顺序不支持
截图&代码:
https://github.com/jeecgboot/jeecg-boot/blob/master/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java里 283行
修改代码为:
The text was updated successfully, but these errors were encountered: