From 56e564448027f04dc566c9ad3d821f822475ff33 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Thu, 6 Apr 2023 14:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iasf/mapper/xml/SysContentMapper.xml | 60 +++++++++++-------- .../service/impl/SysColumnServiceImpl.java | 13 ++-- .../service/impl/SysContentServiceImpl.java | 11 ---- .../huoran/iasf/vo/req/PageContentReqVO.java | 5 -- 4 files changed, 42 insertions(+), 47 deletions(-) diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml index 7ea11b0..5ce486f 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml @@ -43,30 +43,37 @@ AND c.is_disable = #{req.isDisable} + + + ORDER BY c.update_time desc + - - ORDER BY c.update_time desc - + + ORDER BY c.update_time asc + - - ORDER BY c.update_time asc - + + ORDER BY c.release_time desc + - - ORDER BY c.release_time desc - + + ORDER BY c.release_time asc + - - ORDER BY c.release_time asc - + + ORDER BY is_top asc + - - ORDER BY is_top asc - + + ORDER BY is_top desc + - - ORDER BY is_top desc - + + ORDER BY + release_time DESC, + create_time DESC + + @@ -167,11 +174,16 @@ sys_content c WHERE deleted = 1 - AND site_id = 1 + AND site_id = #{req.siteId} AND title LIKE CONCAT('%',#{req.title},'%') + ORDER BY + is_top = 1 DESC, + top_time DESC, + release_time DESC, + create_time DESC - \ No newline at end of file diff --git a/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java index 7f909ca..41ff634 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java @@ -44,6 +44,7 @@ public class SysColumnServiceImpl extends ServiceImpl listWithTreeMenuVisible(PaginationColumnReqVO column) { - if(column.getRole()==null){ + if (column.getRole() == null) { - }else if (column.getRole()!=null||column.getRole().equals("admin") || ObjectUtil.isNotNull(column.isIsadmin()) || column.isIsadmin()){ + } else if (column.getRole() != null || column.getRole().equals("admin") || ObjectUtil.isNotNull(column.isIsadmin()) || column.isIsadmin()) { throw new IllegalArgumentException("参数名不能包含admin"); } //查询所有栏目 @@ -147,14 +148,14 @@ public class SysColumnServiceImpl extends ServiceImpl getsTheSubColumn = baseMapper.getsTheSubColumn(pid, ids,null); + List getsTheSubColumn = baseMapper.getsTheSubColumn(pid, ids, null); return R.success(TreeStructureUtils.buildTree(getsTheSubColumn, pid)); } @Override public R getsSublevelColumnsUnderALevel(Integer parentId, String ids) { - List getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids,null); + List getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids, null); List buildTree = TreeStructureUtils.buildTree(getsTheSubColumn, parentId); return R.success(buildTree); } @@ -166,8 +167,8 @@ public class SysColumnServiceImpl extends ServiceImpl getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids,isSort); + public R getSubColumn(Integer parentId, String ids, Integer isSort) { + List getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids, isSort); return R.success(TreeStructureUtils.forMethod(getsTheSubColumn)); } diff --git a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java index cccfd70..1b4478b 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java @@ -64,17 +64,6 @@ public class SysContentServiceImpl extends ServiceImpl page = new Page(reqVO.getPageNum(), reqVO.getPageSize()); - - //没传任何排序参数时候 默认以发布时间排序 - if (reqVO.getModifiedTimeSort() == null && reqVO.getPublicationTimeSort() == null && reqVO.getTopSort() == null) { - reqVO.setPublicationTimeSort(0); - } - /*if (reqVO.getIsDisable()!=null){ - if (reqVO.getIsDisable() == 1) { - //是否禁用(0默认,0启用 1禁用) - reqVO.setIsDisable(1); - } - }*/ IPage pageList = baseMapper.articlePaginationList(page, reqVO); return R.success(pageList); } diff --git a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java index cc5fe03..828a368 100644 --- a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java +++ b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java @@ -79,14 +79,9 @@ public class PageContentReqVO extends PageReqVO { @ApiModelProperty(value = "发布时间排序(0默认倒序 1升序)") private Integer publicationTimeSort; -/* @ApiModelProperty(value = "序号排序(0默认升序 1倒序)") - private Integer ordinalSort;*/ - @ApiModelProperty(value = "置顶排序(0默认升序 1倒序)") private Integer topSort; - /* @ApiModelProperty(value = "模板状态(0禁用;1启用)") - private Integer templateStatus;*/ @ApiModelProperty(value = "是否禁用(0默认,0启用 1禁用)") private Integer isDisable;