Bladeren bron

Merge remote-tracking branch 'origin/dev' into dev

chenr 2 maanden geleden
bovenliggende
commit
59a027c4d3

+ 6 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -231,9 +231,13 @@
         d.contract_id,
         (SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_archive_tree_contract WHERE parent_id = d.id and is_deleted = 0 and project_id = #{projectId})
         AS "has_children",
-        (SELECT  count(1)  FROM m_archive_tree_contract WHERE  is_deleted = 0 and project_id = #{projectId} and ancestors like CONCAT('%',d.id,'%')
+        (SELECT  count(1)  FROM m_archive_tree_contract a
+                        inner join u_archive_file b on b.node_id = a.id and b.is_deleted = a.is_deleted and b.project_id = a.project_id and (b.is_auto_file is null or b.is_auto_file != 1)
+                           WHERE  a.is_deleted = 0
+                             and a.project_id = #{projectId}
+                             and a.ancestors like CONCAT('%',d.id,'%')
         <if test="code!=null and code!=''">
-            AND (tree_code = #{code} or tree_code = #{contractId} or parent_id = 0)
+            AND (a.tree_code = #{code} or a.tree_code = #{contractId} or a.parent_id = 0)
         </if>
         ) as tree_number
         FROM