|
@@ -315,9 +315,13 @@
|
|
|
WHERE
|
|
|
d.is_deleted = 0
|
|
|
AND d.parent_id = #{parentId}
|
|
|
- AND d.wbs_type = #{wbsType}
|
|
|
AND d.project_id = #{projectId}
|
|
|
- AND d.wbs_id = #{wbsId}
|
|
|
+ <if test="wbsType != null and wbsType != '' and wbsType != -1">
|
|
|
+ AND d.wbs_type = #{wbsType}
|
|
|
+ </if>
|
|
|
+ <if test="wbsId != null and wbsId != '' and wbsType != -1">
|
|
|
+ AND d.wbs_id = #{wbsId}
|
|
|
+ </if>
|
|
|
AND d.type = 1
|
|
|
AND status = 1
|
|
|
ORDER BY d.sort
|
|
@@ -534,64 +538,80 @@
|
|
|
<!-- 项目级 表单类型分类 wbs树 -->
|
|
|
<select id="tabTypeLazyTree" resultMap="treeNodeResultMapTabType">
|
|
|
SELECT p_key_id as id,p_key_id as primaryKeyId,title,parent_id,fill_rate as fillRate,
|
|
|
- (SELECT dict_value from blade_dict where code='table_type' and dict_key not in(-1,0) and dict_key=table_type ) as tabType,
|
|
|
+ (SELECT dict_value from blade_dict where code='table_type' and dict_key not in(-1,0) and dict_key=table_type )
|
|
|
+ as tabType,
|
|
|
(SELECT count(1) FROM m_wbs_form_element WHERE f_id = initTableId and is_deleted=0) AS "elementTotal",
|
|
|
- (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner ) as tabOwner,
|
|
|
- (
|
|
|
- SELECT
|
|
|
- CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT '12345678910' as p_key_id , '表单类型' as node_name, 0 as parent_id
|
|
|
- union all
|
|
|
- SELECT dict_key as p_key_id ,dict_value as node_name,'12345678910' as parent_id from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
- union all
|
|
|
- SELECT p_key_id,node_name,table_type as parent_id from m_wbs_tree_private WHERE project_id=#{projectId} and is_deleted=0 and type=10 and table_type is not NULL GROUP BY node_name
|
|
|
- ) b
|
|
|
- WHERE
|
|
|
- b.parent_id = a.p_key_id
|
|
|
- ) AS "has_children"
|
|
|
- from (
|
|
|
- SELECT '12345678910' as p_key_id , '表单类型' as title, 0 as parent_id,0 as table_type,0 as fill_rate,0 as table_owner,0 as initTableId,0 as exceIds
|
|
|
- union all
|
|
|
- SELECT dict_key as p_key_id ,dict_value as title,'12345678910' as parent_id,0 as table_type,0 as fill_rate,0 as table_owner,0 as initTableId,0 as exceIds from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
- union all
|
|
|
- SELECT p_key_id,node_name as title,table_type as parent_id,table_type,fill_rate,table_owner,init_table_id as initTableId,GROUP_CONCAT(excel_id) as excelIds from m_wbs_tree_private WHERE project_id=#{projectId} and is_deleted=0 and type=10 and table_type is not NULL GROUP BY node_name
|
|
|
- ) a where 1=1
|
|
|
+ (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner )
|
|
|
+ as tabOwner,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT '12345678910' as p_key_id , '表单类型' as node_name, 0 as parent_id
|
|
|
+ union all
|
|
|
+ SELECT dict_key as p_key_id ,dict_value as node_name,'12345678910' as parent_id from blade_dict where
|
|
|
+ code='table_type' and dict_key not in(-1,0)
|
|
|
+ union all
|
|
|
+ SELECT p_key_id,node_name,table_type as parent_id from m_wbs_tree_private WHERE project_id=#{projectId} and
|
|
|
+ is_deleted=0 and type=10 and table_type is not NULL GROUP BY node_name
|
|
|
+ ) b
|
|
|
+ WHERE
|
|
|
+ b.parent_id = a.p_key_id
|
|
|
+ ) AS "has_children"
|
|
|
+ from (
|
|
|
+ SELECT '12345678910' as p_key_id , '表单类型' as title, 0 as parent_id,0 as table_type,0 as fill_rate,0 as
|
|
|
+ table_owner,0 as initTableId,0 as exceIds
|
|
|
+ union all
|
|
|
+ SELECT dict_key as p_key_id ,dict_value as title,'12345678910' as parent_id,0 as table_type,0 as fill_rate,0 as
|
|
|
+ table_owner,0 as initTableId,0 as exceIds from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
+ union all
|
|
|
+ SELECT p_key_id,node_name as title,table_type as parent_id,table_type,fill_rate,table_owner,init_table_id as
|
|
|
+ initTableId,GROUP_CONCAT(excel_id) as excelIds from m_wbs_tree_private WHERE project_id=#{projectId} and
|
|
|
+ is_deleted=0 and type=10 and table_type is not NULL GROUP BY node_name
|
|
|
+ ) a where 1=1
|
|
|
<if test="parentId != null and parentId != ''">
|
|
|
- and a.parent_id = #{parentId}
|
|
|
+ and a.parent_id = #{parentId}
|
|
|
</if>
|
|
|
<if test="titleName != null and titleName != ''">
|
|
|
- and a.title like concat('%',#{titleName},'%') and LENGTH(a.p_key_id)>11
|
|
|
+ and a.title like concat('%',#{titleName},'%') and LENGTH(a.p_key_id)>11
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 项目级 表单类型分类 wbs树 -->
|
|
|
<select id="tabTypeLazyTreeAll" resultMap="treeNodeResultMapTabType">
|
|
|
SELECT p_key_id as id,p_key_id as primaryKeyId,title,parent_id,fill_rate as fillRate,
|
|
|
- (SELECT dict_value from blade_dict where code='table_type' and dict_key not in(-1,0) and dict_key=table_type ) as tabType,
|
|
|
+ (SELECT dict_value from blade_dict where code='table_type' and dict_key not in(-1,0) and dict_key=table_type )
|
|
|
+ as tabType,
|
|
|
(SELECT count(1) FROM m_wbs_form_element WHERE f_id = initTableId and is_deleted=0) AS "elementTotal",
|
|
|
- (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner ) as tabOwner,
|
|
|
+ (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner )
|
|
|
+ as tabOwner,
|
|
|
(
|
|
|
SELECT
|
|
|
CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
|
|
|
FROM
|
|
|
(
|
|
|
- SELECT '12345678910' as p_key_id , '表单类型' as node_name, 0 as parent_id
|
|
|
+ SELECT '12345678910' as p_key_id , '表单类型' as node_name, 0 as parent_id
|
|
|
union all
|
|
|
- SELECT dict_key as p_key_id ,dict_value as node_name,'12345678910' as parent_id from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
+ SELECT dict_key as p_key_id ,dict_value as node_name,'12345678910' as parent_id from blade_dict where
|
|
|
+ code='table_type' and dict_key not in(-1,0)
|
|
|
union all
|
|
|
- SELECT id as p_key_id,node_name,table_type as parent_id from m_wbs_tree_private WHERE is_deleted=0 and type=2 and table_type is not NULL GROUP BY node_name
|
|
|
+ SELECT id as p_key_id,node_name,table_type as parent_id from m_wbs_tree_private WHERE is_deleted=0 and type=2
|
|
|
+ and table_type is not NULL GROUP BY node_name
|
|
|
) b
|
|
|
WHERE
|
|
|
b.parent_id = a.p_key_id
|
|
|
) AS "has_children"
|
|
|
from (
|
|
|
- SELECT '12345678910' as p_key_id , '表单类型' as title, 0 as parent_id,0 as table_type,0 as fill_rate,0 as table_owner,0 as initTableId,0 as exceIds
|
|
|
+ SELECT '12345678910' as p_key_id , '表单类型' as title, 0 as parent_id,0 as table_type,0 as fill_rate,0 as
|
|
|
+ table_owner,0 as initTableId,0 as exceIds
|
|
|
union all
|
|
|
- SELECT dict_key as p_key_id ,dict_value as title,'12345678910' as parent_id,0 as table_type,0 as fill_rate,0 as table_owner,0 as initTableId,0 as exceIds from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
+ SELECT dict_key as p_key_id ,dict_value as title,'12345678910' as parent_id,0 as table_type,0 as fill_rate,0 as
|
|
|
+ table_owner,0 as initTableId,0 as exceIds from blade_dict where code='table_type' and dict_key not in(-1,0)
|
|
|
union all
|
|
|
- SELECT id as p_key_id,node_name as title,table_type as parent_id,table_type,fill_rate,table_owner,init_table_id as initTableId,GROUP_CONCAT(excel_id) as excelIds from m_wbs_tree_private WHERE is_deleted=0 and type=2 and init_table_id is not null and table_type is not NULL GROUP BY node_name
|
|
|
+ SELECT id as p_key_id,node_name as title,table_type as parent_id,table_type,fill_rate,table_owner,init_table_id
|
|
|
+ as initTableId,GROUP_CONCAT(excel_id) as excelIds from m_wbs_tree_private WHERE is_deleted=0 and type=2 and
|
|
|
+ init_table_id is not null and table_type is not NULL GROUP BY node_name
|
|
|
) a where 1=1
|
|
|
<if test="parentId != null and parentId != ''">
|
|
|
and a.parent_id = #{parentId}
|