Browse Source

增加警员中心显示顺序字段, 按照组织机构、人员顺序来展示,确保局领导、部分领导排在前面;

main
sjh 1 year ago
parent
commit
0f5a9cd1b2
  1. 4
      src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java
  2. 17
      src/main/java/com/biutag/supervision/service/SupPoliceService.java

4
src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java

@ -15,4 +15,8 @@ public class PoliceQueryParam extends BasePage {
// 当前单位及其所有子单位 // 当前单位及其所有子单位
private Boolean departBranch; private Boolean departBranch;
private String roleId; private String roleId;
// 排序字段
private String sortField;
// 排序顺序(ASC 或 DESC)
private String sortOrder;
} }

17
src/main/java/com/biutag/supervision/service/SupPoliceService.java

@ -50,6 +50,23 @@ public class SupPoliceService extends ServiceImpl<SupPoliceMapper, SupPolice> {
} }
} }
queryWrapper.apply(StrUtil.isNotBlank(param.getRoleId()), String.format("find_in_set( '%s', u.role_id) > 0", param.getRoleId())); queryWrapper.apply(StrUtil.isNotBlank(param.getRoleId()), String.format("find_in_set( '%s', u.role_id) > 0", param.getRoleId()));
if (param.getSortField() != null && param.getSortOrder() != null) {
if (param.getSortField().equals("depart")) {
if (param.getSortOrder().equals("ASC")) {
queryWrapper.orderByAsc("d.short_name");
} else if (param.getSortOrder().equals("DESC")) {
queryWrapper.orderByDesc("d.short_name");
}
} else if (param.getSortField().equals("property")) {
if (param.getSortOrder().equals("ASC")) {
queryWrapper.orderByAsc("p.person_type");
} else if (param.getSortOrder().equals("DESC")) {
queryWrapper.orderByDesc("p.person_type");
}
}
}
queryWrapper.orderByDesc("field(p.job,'辅警','民警','四级机构副职','四级机构正职','三级机构副职','三级机构正职二','三级机构正职一','二级机构副职','二级机构正职二','二级机构正职一','市局领导副职','市局领导正职')");
queryWrapper.orderByDesc("field(p.position,'副职','正职')");
queryWrapper.orderByAsc("d.level").orderByDesc("p.position").orderByDesc("p.sort_id").orderByAsc("p.person_status"); queryWrapper.orderByAsc("d.level").orderByDesc("p.position").orderByDesc("p.sort_id").orderByAsc("p.person_status");
return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
} }

Loading…
Cancel
Save