|
@@ -539,12 +539,8 @@
|
|
|
(CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
|
|
|
if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
|
|
|
(CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
|
|
|
- (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
|
|
|
-
|
|
|
- (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
|
|
|
-
|
|
|
+ atc.node_name as node_name ,
|
|
|
+ ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
|
|
|
from m_archive_tree_contract atc
|
|
|
WHERE is_deleted =0 and project_id = #{projectId}
|
|
|
and (id = #{ownerUnit} or FIND_IN_SET(#{ownerUnit},ancestors))
|
|
@@ -557,10 +553,8 @@
|
|
|
(CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
|
|
|
if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
|
|
|
(CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
|
|
|
- (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
|
|
|
- (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
|
|
|
+ atc.node_name as node_name ,
|
|
|
+ ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
|
|
|
from m_archive_tree_contract atc
|
|
|
WHERE is_deleted =0 and project_id = #{projectId}
|
|
|
and (id = #{supervisorUnit} or FIND_IN_SET(#{supervisorUnit},ancestors))
|
|
@@ -573,10 +567,8 @@
|
|
|
(CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
|
|
|
if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
|
|
|
(CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
|
|
|
- (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
|
|
|
- (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
|
|
|
+ atc.node_name as node_name ,
|
|
|
+ ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
|
|
|
from m_archive_tree_contract atc
|
|
|
WHERE is_deleted =0 and project_id = #{projectId}
|
|
|
and (id = #{buildUnit} or FIND_IN_SET(#{buildUnit},ancestors))
|
|
@@ -587,11 +579,8 @@
|
|
|
select id,parent_id,
|
|
|
(CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
|
|
|
if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
|
|
|
--- (CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
|
|
|
- (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), ')')) as node_name,
|
|
|
- (select COUNT(1) from u_archives_auto WHERE is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
|
|
|
- and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
|
|
|
+ atc.node_name as node_name ,
|
|
|
+ ( select count(1) from u_archives_auto where project_id = #{projectId} and is_apply = 1 and is_deleted = 0) as total
|
|
|
from m_archive_tree_contract atc
|
|
|
WHERE atc.parent_id = 0 and atc.is_deleted = 0 and project_id =#{projectId}
|
|
|
</select>
|