forked from Gitlink/microservices
Merge pull request '列表中文件夹类型文件,返回是否存在子文件夹' (#868) from wanjia9506/microservices:feat_document_126283 into master
This commit is contained in:
commit
0f689986f2
|
|
@ -72,4 +72,7 @@ public class PmsDocumentVo
|
|||
|
||||
@ApiModelProperty(value = "是否被收藏")
|
||||
private Boolean isFavour;
|
||||
|
||||
@ApiModelProperty(value = "是否存在子文件夹")
|
||||
private Boolean hasChildDir=false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,4 +86,6 @@ public interface PmsDocumentMapper
|
|||
Long[] selectLinkedRepoIds(@Param("enterpriseId") Long enterpriseId, @Param("projectId") Long projectId);
|
||||
|
||||
List<PmsDocument> selectPmsFavoriteDocumentList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
|
||||
|
||||
boolean hasChildDirById(@Param("documentId") Long documentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,6 +231,9 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
}
|
||||
pmsDocumentVo.setWikiRepositorySimpleInfo(wikiRepositoryInfo);
|
||||
pmsDocumentVo.setIsFavour(pmsDocumentUserFavoriteMapper.isDocumentInFavorites(SecurityUtils.getUserId(), pmsDocument.getId()));
|
||||
if (PmsDocumentType.DOCUMENT_DIRECTORY.getKey() == pmsDocumentVo.getDocType()) {
|
||||
pmsDocumentVo.setHasChildDir(pmsDocumentMapper.hasChildDirById(pmsDocument.getId()));
|
||||
}
|
||||
return pmsDocumentVo;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,4 +230,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and pms_project_id = #{projectId}
|
||||
and wiki_gitlink_repo_id is not null
|
||||
</select>
|
||||
<select id="hasChildDirById" resultType="java.lang.Boolean">
|
||||
select count(*)
|
||||
from pms_document
|
||||
where parent_id = #{documentId}
|
||||
and doc_type = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue