提交代码

master
rong.liu 2 years ago
parent 1baaf672a2
commit f2d4bb224a
  1. 5
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 2
      src/main/java/com/huoran/iasf/mapper/SysColumnMapper.java
  3. 64
      src/main/java/com/huoran/iasf/mapper/xml/SysColumnMapper.xml
  4. 3
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml
  5. 2
      src/main/java/com/huoran/iasf/service/SysColumnService.java
  6. 8
      src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java

@ -217,11 +217,12 @@ public class SysColumnController {
@ApiOperation("某一级查全部")
@PostMapping("/oneLevelChecksThemAll")
public R oneLevelChecksThemAll(@ApiParam(name = "id", value = "栏目id", required = true) @RequestParam Integer id) {
public R oneLevelChecksThemAll(@ApiParam(name = "id", value = "栏目id", required = true) @RequestParam Integer id,
@ApiParam(name = "isSort", value = "判断是否为排序接口调用(1为排序接口调用 0我栏目管理列表调用)", required = true) @RequestParam Integer isSort) {
Integer pid = service.oneLevelChecksThemAll(id);
String ids = this.getIds(pid);
return service.getSubColumn(pid, ids);
return service.getSubColumn(pid, ids,isSort);
}

@ -34,7 +34,7 @@ public interface SysColumnMapper extends BaseMapper<SysColumn> {
//依据子级查询父级
List<FatherContentRespVO> getParentInformationBasedOnChild(@Param("id")Integer id);
List<SysColumn> getsTheSubColumn(@Param("parentId")Integer parentId ,@Param("ids")String ids);
List<SysColumn> getsTheSubColumn(@Param("parentId")Integer parentId ,@Param("ids")String ids ,@Param("isSort")Integer isSort);
Integer oneLevelChecksThemAll(@Param("theChildId")Integer theChildId);

@ -148,53 +148,51 @@
</select>-->
<select id="getsTheSubColumn" resultType="com.huoran.iasf.entity.SysColumn">
SELECT *,
(SELECT u.username FROM sys_user u WHERE u.id = s.founder_id) AS creteUser,
(SELECT u.username FROM sys_user u WHERE u.id = s.editor_id) AS editorUser,
(SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id) AS templateName,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS listStyle,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id) AS detailStyle,
(SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS path
(SELECT u.username FROM sys_user u WHERE u.id = s.founder_id) AS creteUser,
(SELECT u.username FROM sys_user u WHERE u.id = s.editor_id) AS editorUser,
(SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id) AS templateName,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS listStyle,
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id) AS detailStyle,
(SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS path
FROM sys_column s
WHERE deleted = 1
AND site_id = 1
AND site_id = 1
<if test="ids != '' and ids!= null">
and FIND_IN_SET(s.id, #{ids})
and FIND_IN_SET(s.id, #{ids})
</if>
ORDER BY
s.create_time asc
<if test="isSort== 1">
ORDER BY
s.sort ASC
</if>
<if test="isSort=='' and isSort == null">
ORDER BY
s.create_time asc
</if>
</select>
<select id="oneLevelChecksThemAll" resultType="java.lang.Integer">
SELECT
id
FROM
(
SELECT
@r AS _id,
SELECT id
FROM (SELECT @r AS _id,
( SELECT @r := father_id FROM sys_column WHERE id = _id ) AS fatherId,
@l := @l + 1 AS lvl
FROM
( SELECT @r := #{theChildId}, @l := 0 ) vars,
sys_column h
WHERE
@r != 0
) T1
JOIN sys_column T2 ON T1._id = T2.id
FROM
( SELECT @r := #{theChildId}, @l := 0 ) vars, sys_column h
WHERE
@r != 0) T1
JOIN sys_column T2 ON T1._id = T2.id
WHERE
deleted = 1
ORDER BY
T1.lvl DESC limit 0,1
T1.lvl DESC limit 0, 1
</select>
<select id="queryByColumnType" resultType="com.huoran.iasf.entity.SysColumn">
SELECT
id,
father_id,
column_name,
list_style_id
FROM
sys_column s
WHERE
FIND_IN_SET( s.id, #{ids} )
SELECT id,
father_id,
column_name,
list_style_id
FROM sys_column s
WHERE FIND_IN_SET(s.id, #{ids})
GROUP BY list_style_id
</select>

@ -57,6 +57,7 @@
sys_content s
WHERE
is_disable = 0
AND s.deleted = 1
AND is_release = 1
) t
WHERE
@ -157,6 +158,8 @@
) t
WHERE
FIND_IN_SET( t.column_id, #{columnId} )
ORDER BY t.create_time desc
</select>

@ -38,7 +38,7 @@ public interface SysColumnService extends IService<SysColumn> {
Integer oneLevelChecksThemAll(Integer theChildId);
R getSubColumn(Integer parentId,String ids);
R getSubColumn(Integer parentId,String ids,Integer isSort);
R queryArticlesByColumnType(String ids,Integer id);

@ -140,14 +140,14 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
@Override
public R getsTheSubColumn(Integer pid, String ids) {
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(pid, ids);
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(pid, ids,null);
return R.success(TreeStructureUtils.buildTree(getsTheSubColumn, pid));
}
@Override
public R getsSublevelColumnsUnderALevel(Integer parentId, String ids) {
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids);
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids,null);
List<SysColumn> buildTree = TreeStructureUtils.buildTree(getsTheSubColumn, parentId);
return R.success(buildTree);
}
@ -159,8 +159,8 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
}
@Override
public R getSubColumn(Integer parentId, String ids) {
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids);
public R getSubColumn(Integer parentId, String ids,Integer isSort) {
List<SysColumn> getsTheSubColumn = baseMapper.getsTheSubColumn(parentId, ids,isSort);
return R.success(TreeStructureUtils.forMethod(getsTheSubColumn));
}

Loading…
Cancel
Save