提交代码

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("某一级查全部") @ApiOperation("某一级查全部")
@PostMapping("/oneLevelChecksThemAll") @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); Integer pid = service.oneLevelChecksThemAll(id);
String ids = this.getIds(pid); 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<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); Integer oneLevelChecksThemAll(@Param("theChildId")Integer theChildId);

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

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

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

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

Loading…
Cancel
Save