上报库-详情页数据表头排序。
This commit is contained in:
+6
-1
@@ -145,7 +145,12 @@
|
||||
select prd.*
|
||||
from params_report_detail prd
|
||||
<include refid="BaseQuerySql2"/>
|
||||
order by sync_time desc, nio_number asc
|
||||
<if test="paramsReportDetailVO.orderBySql != null">
|
||||
${paramsReportDetailVO.orderBySql}
|
||||
</if>
|
||||
<if test="paramsReportDetailVO.orderBySql == null">
|
||||
order by sync_time desc, nio_number asc
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listInfoForExport" resultType="java.util.LinkedHashMap">
|
||||
|
||||
+21
@@ -125,6 +125,18 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
public IPage queryList(IPage page, ParamsReportDetailVO paramsReportDetailVO, String cut) {
|
||||
String paramsManifestId = paramsReportDetailVO.getParamsManifestId();
|
||||
|
||||
// 如果排序字段不为空
|
||||
if(StringUtils.isNotEmpty(paramsReportDetailVO.getOrderByField())){`
|
||||
StringBuilder sqlSb = new StringBuilder();
|
||||
sqlSb.append(" ORDER BY ").append(paramsReportDetailVO.getOrderByField());
|
||||
if(StringUtils.equals(paramsReportDetailVO.getOrderBy(),"1")){
|
||||
sqlSb.append(" ASC");
|
||||
}else {
|
||||
sqlSb.append(" DESC");
|
||||
}
|
||||
paramsReportDetailVO.setOrderBySql(sqlSb.toString());
|
||||
}
|
||||
|
||||
IPage pageInfo = paramsReportDetailEOMapper.pageInfo(page, paramsReportDetailVO); // 查询固定列
|
||||
List<ParamsReportDetailEO> list = pageInfo.getRecords(); // 查询固定列
|
||||
List<ParamsReportConfigEO> paramsConfigEOList = paramsReportConfigEOService.queryList(paramsManifestId); // 查询配置列
|
||||
@@ -586,6 +598,15 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
map.put("orderNum",orderNumStart);
|
||||
orderNumStart ++;
|
||||
}
|
||||
|
||||
if(StringUtils.equals(dbFieldName,"nio_number")
|
||||
||StringUtils.equals(dbFieldName,"sdt")
|
||||
||StringUtils.equals(dbFieldName,"dre")
|
||||
||StringUtils.equals(dbFieldName,"sync_time")
|
||||
){
|
||||
map.put("sort","true");
|
||||
}
|
||||
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.cert.report.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -60,4 +61,15 @@ public class ParamsReportDetailVO {
|
||||
|
||||
private String allNumber;
|
||||
|
||||
|
||||
//排序字段
|
||||
@TableField(exist = false)
|
||||
private String orderByField;
|
||||
|
||||
//排序规则 ”1“ 顺序 ”2“逆序
|
||||
@TableField(exist = false)
|
||||
private String orderBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orderBySql;
|
||||
}
|
||||
|
||||
@@ -639,6 +639,8 @@
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
if(sorter.columnKey == 'nioNumber'){
|
||||
sorter.columnKey = 'nio_number'
|
||||
}else if (sorter.columnKey == 'syncTime'){
|
||||
sorter.columnKey = 'sync_time'
|
||||
}
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
|
||||
Reference in New Issue
Block a user