提交代码

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. 32
      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);

@ -161,40 +161,38 @@
and FIND_IN_SET(s.id, #{ids})
</if>
<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
( SELECT @r := #{theChildId}, @l := 0 ) vars, sys_column h
WHERE
@r != 0
) T1
@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,
SELECT id,
father_id,
column_name,
list_style_id
FROM
sys_column s
WHERE
FIND_IN_SET( s.id, #{ids} )
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