From 6b75a6e611a5876d6830a7717c50ede0b87df4dc Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Wed, 31 Aug 2022 15:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iasf/controller/SysColumnController.java | 5 ++--- .../com/huoran/iasf/mapper/xml/SysColumnMapper.xml | 5 ++++- .../huoran/iasf/mapper/xml/SysContentMapper.xml | 14 ++++++++++++++ .../com/huoran/iasf/vo/req/PageContentReqVO.java | 10 +++++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/huoran/iasf/controller/SysColumnController.java b/src/main/java/com/huoran/iasf/controller/SysColumnController.java index 138d120..eff8814 100644 --- a/src/main/java/com/huoran/iasf/controller/SysColumnController.java +++ b/src/main/java/com/huoran/iasf/controller/SysColumnController.java @@ -94,8 +94,7 @@ public class SysColumnController { SysColumn sysColumn = new SysColumn(); BeanUtils.copyProperties(sort, sysColumn); service.updateById(sysColumn); - - //更改栏目下的文章 设置栏目id为新的栏目id + //依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("column_id", sysColumn.getId()); List contentList = contentService.list(queryWrapper); @@ -103,7 +102,7 @@ public class SysColumnController { for (SysContent content : contentList) { UpdateWrapper updateWrapper = new UpdateWrapper<>(); updateWrapper.set("column_id", sysColumn.getId()); - contentService.update(content,updateWrapper); + contentService.update(content, updateWrapper); } } diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml index 49f3db7..d6d6252 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml @@ -41,7 +41,10 @@ and column_name LIKE CONCAT('%',#{vo.columnName},'%') - + ORDER BY + s.father_id, + s.sort ASC, + s.create_time desc 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 928cea9..c68d90b 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml @@ -49,6 +49,20 @@ and title LIKE CONCAT('%',#{req.title},'%') + + AND ( SELECT u.username FROM sys_user u WHERE u.id = c.founder_id ) LIKE + CONCAT('%',#{req.founder},'%') + + + + + AND ( SELECT u.username FROM sys_user u WHERE u.id = c.editor_id ) LIKE CONCAT('%',#{req.editor},'%') + + + + AND ( SELECT sys_column.column_name FROM sys_column WHERE sys_column.id = c.column_id ) LIKE + CONCAT('%',#{req.column},'%') + ORDER BY c.create_time desc 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 b5c11af..757ea7f 100644 --- a/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java +++ b/src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java @@ -21,10 +21,18 @@ public class PageContentReqVO extends PageReqVO { @ApiModelProperty(value = "标题") private String title; + @ApiModelProperty(value = "创建人") + private String founder; + + @ApiModelProperty(value = "编辑人") + private String editor; + + @ApiModelProperty(value = "栏目") + private String column; + @ApiModelProperty(value = "站点id") @NotNull(message = "站点id不能为空!") private Integer siteId; - } \ No newline at end of file