| | |
| | | NcNode node = this.getById(id); |
| | | return this.baseMapper.historyByParentIdAndName(node.getParentId(),node.getName()); |
| | | } |
| | | |
| | | /** |
| | | * 获取“程序包名”的最新版本 |
| | | * @param name 节点名称 |
| | | * @return 最新版本程序报名节点 |
| | | */ |
| | | public NcNode getLastEditionProgramPackage(String name){ |
| | | List<NcNode> pkgList = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, name).eq(NcNode::getIsLastEdition,1).orderByDesc(NcNode::getCreateTime).list(); |
| | | |
| | | if(pkgList.isEmpty()){ |
| | | return null; |
| | | }else{ |
| | | return pkgList.get(0); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据父节点和名称,查询文件界节点列表 |
| | | * @param name 节点/文件名称 |
| | | * @param parentId 父节点id |
| | | */ |
| | | public NcNode getLastEditionProgramFile(String name,Long parentId) { |
| | | List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_FILE) |
| | | .eq(NcNode::getName, name).eq(NcNode::getParentId,parentId) |
| | | .eq(NcNode::getIsLastEdition,1).list(); |
| | | if(nodes.isEmpty()){ |
| | | return null; |
| | | }else { |
| | | return nodes.get(0); |
| | | } |
| | | } |
| | | } |