|
@@ -326,38 +326,42 @@
|
|
|
|
|
|
<select id="lazyTree" resultMap="treeNodeResultMap">
|
|
|
SELECT
|
|
|
- d.p_key_id as "primaryKeyId",
|
|
|
- d.type AS "type",
|
|
|
- d.table_type,
|
|
|
- d.id,
|
|
|
- d.parent_id,
|
|
|
- d.node_name AS title,
|
|
|
- d.node_type AS "nodeType",
|
|
|
- d.id AS "value",
|
|
|
- d.id AS "key",
|
|
|
- d.major_data_type AS "majorDataType",
|
|
|
- d.is_exist_form AS "isExistForm",
|
|
|
- d.mix_ratio_test_ids AS "mixRatioTestIds",
|
|
|
- (
|
|
|
- SELECT
|
|
|
- CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
|
|
|
+ d.p_key_id as "primaryKeyId",
|
|
|
+ d.type AS "type",
|
|
|
+ d.table_type,
|
|
|
+ d.id,
|
|
|
+ d.parent_id,
|
|
|
+ CASE
|
|
|
+ WHEN d.parent_id = 0 THEN
|
|
|
+ (SELECT project_alias FROM m_project_info WHERE id = #{projectId})
|
|
|
+ ELSE d.node_name
|
|
|
+ END AS title,
|
|
|
+ d.node_type AS "nodeType",
|
|
|
+ d.id AS "value",
|
|
|
+ d.id AS "key",
|
|
|
+ d.major_data_type AS "majorDataType",
|
|
|
+ d.is_exist_form AS "isExistForm",
|
|
|
+ d.mix_ratio_test_ids AS "mixRatioTestIds",
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
|
|
|
+ FROM
|
|
|
+ m_wbs_tree_private
|
|
|
+ WHERE
|
|
|
+ parent_id = d.id and is_deleted = 0 and type != 2
|
|
|
+ ) AS "has_children"
|
|
|
FROM
|
|
|
- m_wbs_tree_private
|
|
|
+ m_wbs_tree_private d
|
|
|
WHERE
|
|
|
- parent_id = d.id and is_deleted = 0 and type != 2
|
|
|
- ) AS "has_children"
|
|
|
- FROM
|
|
|
- m_wbs_tree_private d
|
|
|
- WHERE
|
|
|
- d.is_deleted = 0
|
|
|
+ d.is_deleted = 0
|
|
|
AND d.parent_id = #{parentId}
|
|
|
AND d.project_id = #{projectId}
|
|
|
- <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>
|
|
|
+ <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
|