代码提交

master
rong.liu 2 years ago
parent 28dcd55442
commit 6b75a6e611
  1. 5
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 5
      src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml
  3. 14
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml
  4. 10
      src/main/java/com/huoran/iasf/vo/req/PageContentReqVO.java

@ -94,8 +94,7 @@ public class SysColumnController {
SysColumn sysColumn = new SysColumn(); SysColumn sysColumn = new SysColumn();
BeanUtils.copyProperties(sort, sysColumn); BeanUtils.copyProperties(sort, sysColumn);
service.updateById(sysColumn); service.updateById(sysColumn);
//依据当前循环获取的栏目id,查询到引用当前栏目的文章对其进行修改栏目id
//更改栏目下的文章 设置栏目id为新的栏目id
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id", sysColumn.getId()); queryWrapper.eq("column_id", sysColumn.getId());
List<SysContent> contentList = contentService.list(queryWrapper); List<SysContent> contentList = contentService.list(queryWrapper);
@ -103,7 +102,7 @@ public class SysColumnController {
for (SysContent content : contentList) { for (SysContent content : contentList) {
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("column_id", sysColumn.getId()); updateWrapper.set("column_id", sysColumn.getId());
contentService.update(content,updateWrapper); contentService.update(content, updateWrapper);
} }
} }

@ -41,7 +41,10 @@
<if test="vo.columnName != '' and vo.columnName!= null"> <if test="vo.columnName != '' and vo.columnName!= null">
and column_name LIKE CONCAT('%',#{vo.columnName},'%') and column_name LIKE CONCAT('%',#{vo.columnName},'%')
</if> </if>
ORDER BY
s.father_id,
s.sort ASC,
s.create_time desc
</select> </select>

@ -49,6 +49,20 @@
<if test="req.title != null and req.title != ''"> <if test="req.title != null and req.title != ''">
and title LIKE CONCAT('%',#{req.title},'%') and title LIKE CONCAT('%',#{req.title},'%')
</if> </if>
<if test="req.founder != null and req.founder != ''">
AND ( SELECT u.username FROM sys_user u WHERE u.id = c.founder_id ) LIKE
CONCAT('%',#{req.founder},'%')
</if>
<if test="req.editor != null and req.editor != ''">
AND ( SELECT u.username FROM sys_user u WHERE u.id = c.editor_id ) LIKE CONCAT('%',#{req.editor},'%')
</if>
<if test="req.column != null and req.column != ''">
AND ( SELECT sys_column.column_name FROM sys_column WHERE sys_column.id = c.column_id ) LIKE
CONCAT('%',#{req.column},'%')
</if>
ORDER BY c.create_time desc ORDER BY c.create_time desc

@ -21,10 +21,18 @@ public class PageContentReqVO extends PageReqVO {
@ApiModelProperty(value = "标题") @ApiModelProperty(value = "标题")
private String title; private String title;
@ApiModelProperty(value = "创建人")
private String founder;
@ApiModelProperty(value = "编辑人")
private String editor;
@ApiModelProperty(value = "栏目")
private String column;
@ApiModelProperty(value = "站点id") @ApiModelProperty(value = "站点id")
@NotNull(message = "站点id不能为空!") @NotNull(message = "站点id不能为空!")
private Integer siteId; private Integer siteId;
} }
Loading…
Cancel
Save