feat:添加排序

hangao-new
wangxy 10 months ago
parent 5ab0679421
commit aa3a7d3368

@ -227,36 +227,20 @@ public class HomeController {
@RequestParam(required = false ) String columnId) { @RequestParam(required = false ) String columnId) {
//部门动态对应的栏目 //部门动态对应的栏目
List<SysColumn> deptColumns = null; List<SysColumn> deptColumns = columnService.lambdaQuery()
if(StringUtils.isNotBlank(columnId)){ .eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE)
deptColumns = columnService.lambdaQuery() .eq(SysColumn::getColumnGrade, COLUMN_GRADE)
.eq(SysColumn::getParentId,columnId) .eq(SysColumn::getStatus,STATUS)
.list(); .orderByAsc(SysColumn::getOrderNum)
} else{ .list();
deptColumns = columnService.lambdaQuery()
.eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE)
.eq(SysColumn::getColumnGrade, COLUMN_GRADE)
.eq(SysColumn::getStatus,STATUS)
.list();
}
if(CollUtil.isEmpty(deptColumns)){
deptColumns = columnService.lambdaQuery()
.eq(SysColumn::getColumnId,columnId)
.eq(SysColumn::getStatus,STATUS)
.list();
}
mmap.put("deptColumns", deptColumns); mmap.put("deptColumns", deptColumns);
List<String> columnIdList = deptColumns.stream().map(SysColumn::getColumnId).collect(Collectors.toList());
PageMethod.startPage(pageNum,pageSize); PageMethod.startPage(pageNum,pageSize);
//部门动态 //部门动态
LambdaQueryWrapper<SysDeptTrends> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysDeptTrends> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysDeptTrends::getStatus,STATUS); queryWrapper.eq(SysDeptTrends::getStatus,STATUS);
if(CollUtil.isNotEmpty(columnIdList)){ if(StringUtils.isNotBlank(columnId)){
queryWrapper.in(SysDeptTrends::getColumnId,columnIdList); queryWrapper.eq(SysDeptTrends::getColumnId, columnId);
}else{
queryWrapper.eq(SysDeptTrends::getColumnId, null);
} }
List<SysDeptTrends> deptTrends = trendsService.list(queryWrapper); List<SysDeptTrends> deptTrends = trendsService.list(queryWrapper);
PageInfo<SysDeptTrends> page = new PageInfo<>(deptTrends, pageSize); PageInfo<SysDeptTrends> page = new PageInfo<>(deptTrends, pageSize);
@ -313,6 +297,7 @@ public class HomeController {
.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE) .eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE)
.eq(SysColumn::getColumnGrade, COLUMN_GRADE) .eq(SysColumn::getColumnGrade, COLUMN_GRADE)
.eq(SysColumn::getStatus,STATUS) .eq(SysColumn::getStatus,STATUS)
.orderByAsc(SysColumn::getOrderNum)
.list(); .list();
mmap.put("specialColumns", specialColumns); mmap.put("specialColumns", specialColumns);

Loading…
Cancel
Save