feat:添加排序

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

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

Loading…
Cancel
Save