|
@@ -97,12 +97,17 @@
|
|
|
<result column="title" property="title"/>
|
|
|
<result column="has_children" property="hasChildren"/>
|
|
|
<result column="primaryKeyId" property="primaryKeyId"/>
|
|
|
+ <result column="pkeyId" property="pkeyId"/>
|
|
|
<result column="tabOwner" property="tabOwner"/>
|
|
|
<result column="tabType" property="tabType"/>
|
|
|
<result column="elementTotal" property="elementTotal"/>
|
|
|
<result column="fillRate" property="fillRate"/>
|
|
|
<result column="initTableId" property="initTableId"/>
|
|
|
+ <result column="initTableName" property="initTableName"/>
|
|
|
<result column="excelIds" property="excelIds"/>
|
|
|
+ <result column="excelId" property="excelId"/>
|
|
|
+ <result column="table_type" property="tableType"/>
|
|
|
+ <result column="table_owner" property="tableOwner"/>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
@@ -875,7 +880,7 @@
|
|
|
delete
|
|
|
from m_wbs_tree_private
|
|
|
WHERE p_key_id = #{pKeyId}
|
|
|
- and project_id = #{projectId}AND type = 10
|
|
|
+ and project_id = #{projectId} AND type in(2, 10)
|
|
|
</delete>
|
|
|
|
|
|
<delete id="delTableById">
|
|
@@ -958,4 +963,53 @@
|
|
|
from u_contract_log ucl
|
|
|
where contract_id = #{contractId} and is_deleted = 0 and pdf_url IS NOT NULL order by record_time
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 项目级 表单类型分类 wbs树 -->
|
|
|
+ <select id="tabTypeLazyTreeByProject" resultMap="treeNodeResultMapTabType">
|
|
|
+ SELECT a.exceIds AS excelIds,initTableName,a.exceIds as excelId,table_type, table_owner,
|
|
|
+ p_key_id as id,p_key_id as primaryKeyId,title,parent_id,fill_rate as fillRate,initTableId,p_key_id as pkeyId,
|
|
|
+ (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 sort FROM m_wbs_node_sort c WHERE a.p_key_id = c.p_key_id) AS sort,
|
|
|
+ (
|
|
|
+ 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 in(2,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,0 as initTableName
|
|
|
+ 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 exceIsd,0 as initTableName 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,excel_id AS excelIds,init_table_name as initTableName
|
|
|
+ from m_wbs_tree_private WHERE project_id=#{projectId} and type in(2,10) and
|
|
|
+ is_deleted=0 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}
|
|
|
+ </if>
|
|
|
+ <if test="titleName != null and titleName != ''">
|
|
|
+ and a.title like concat('%',#{titleName},'%') and LENGTH(a.p_key_id)>11
|
|
|
+ </if>
|
|
|
+ /*排序*/
|
|
|
+ -- order by sort,title
|
|
|
+ </select>
|
|
|
</mapper>
|