同步资源排序

This commit is contained in:
cjw 2024-06-21 11:31:14 +08:00
parent 9cad37f9be
commit e9285a11e0
5 changed files with 22 additions and 1 deletions

View File

@ -50,5 +50,8 @@ public class SysOssResource extends TenantEntity {
*/ */
private Integer status; private Integer status;
private Long downloadNum;
private Long previewNum;
} }

View File

@ -54,4 +54,7 @@ public class SysOssTextbook extends TenantEntity {
*/ */
private Integer status; private Integer status;
private Long downloadNum;
private Long previewNum;
} }

View File

@ -56,6 +56,7 @@ public class SysOssResourceVo implements Serializable {
private Integer status; private Integer status;
private Long downloadNum; private Long downloadNum;
private Long previewNum;
/** /**
* 容量 * 容量

View File

@ -63,6 +63,7 @@ public class SysOssTextbookVo implements Serializable {
private Integer status; private Integer status;
private Long downloadNum; private Long downloadNum;
private Long previewNum;
/** /**
* 容量 * 容量

View File

@ -107,7 +107,20 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
List<Long> ids = StreamUtils.toList(list, SysCatalogTextbook::getCatalogId); List<Long> ids = StreamUtils.toList(list, SysCatalogTextbook::getCatalogId);
ids.add(bo.getCatalogId()); ids.add(bo.getCatalogId());
w.in("ot.catalog_id", ids); w.in("ot.catalog_id", ids);
}).orderByDesc("ot.create_time"); });
if (ObjectUtil.isNotNull(bo.getParams().get("downloadDesc"))) {
wrapper.orderByDesc("ot.download_num");
} else if (ObjectUtil.isNotNull(bo.getParams().get("downloadAsc"))) {
wrapper.orderByAsc("ot.download_num");
} else if (ObjectUtil.isNotNull(bo.getParams().get("previewDesc"))) {
wrapper.orderByDesc("ot.preview_num");
} else if (ObjectUtil.isNotNull(bo.getParams().get("previewAsc"))) {
wrapper.orderByAsc("ot.preview_num");
} else if (ObjectUtil.isNotNull(bo.getParams().get("timeAsc"))) {
wrapper.orderByAsc("ot.create_time");
} else {
wrapper.orderByDesc("ot.create_time");
}
return wrapper; return wrapper;
} }