|
@@ -43,4 +43,178 @@
|
|
|
select * from m_archive_tree_contract where is_deleted = 0
|
|
|
</select>
|
|
|
|
|
|
+ <resultMap id="treeNodeResultMap" type="org.springblade.manager.vo.TreeNodeVO2">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="parent_id" property="parentId"/>
|
|
|
+ <result column="title" property="title"/>
|
|
|
+ <result column="value" property="value"/>
|
|
|
+ <result column="key" property="key"/>
|
|
|
+ <result column="has_children" property="hasChildren"/>
|
|
|
+ <result column="displayHierarchy" property="displayHierarchy"/>
|
|
|
+ <result column="majorDataType" property="majorDataType"/>
|
|
|
+ <result column="isStorageNode" property="isStorageNode"/>
|
|
|
+ <result column="isDisplayTree" property="isDisplayTree"/>
|
|
|
+ <result column="isStorageNode" property="isStorageNode"/>
|
|
|
+ <result column="isBuiltDrawing" property="isBuiltDrawing"/>
|
|
|
+ <result column="postType" property="postType"/>
|
|
|
+ <result column="project_type" property="projectType"/>
|
|
|
+ <result column="storage_type" property="storageType"/>
|
|
|
+ <result column="ext_type" property="extType"/>
|
|
|
+ <result column="ext_id" property="extId"/>
|
|
|
+ <result column="archive_auto_type" property="archiveAutoType"/>
|
|
|
+ <result column="archive_auto_node_id" property="archiveAutoNodeId"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="ArchiveTreeContractVO2ResultMap" type="org.springblade.manager.vo.ArchiveTreeContractVO2">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="parent_id" property="parentId"/>
|
|
|
+ <result column="title" property="title"/>
|
|
|
+ <result column="value" property="value"/>
|
|
|
+ <result column="key" property="key"/>
|
|
|
+ <result column="has_children" property="hasChildren"/>
|
|
|
+ <result column="displayHierarchy" property="displayHierarchy"/>
|
|
|
+ <result column="majorDataType" property="majorDataType"/>
|
|
|
+ <result column="isStorageNode" property="isStorageNode"/>
|
|
|
+ <result column="isDisplayTree" property="isDisplayTree"/>
|
|
|
+ <result column="isStorageNode" property="isStorageNode"/>
|
|
|
+ <result column="isBuiltDrawing" property="isBuiltDrawing"/>
|
|
|
+ <result column="postType" property="postType"/>
|
|
|
+ <result column="project_type" property="projectType"/>
|
|
|
+ <result column="storage_type" property="storageType"/>
|
|
|
+ <result column="ext_type" property="extType"/>
|
|
|
+ <result column="ext_id" property="extId"/>
|
|
|
+ <result column="archive_auto_type" property="archiveAutoType"/>
|
|
|
+ <result column="archive_auto_node_id" property="archiveAutoNodeId"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="lazyTree" resultMap="treeNodeResultMap">
|
|
|
+ SELECT
|
|
|
+ d.id,
|
|
|
+ d.parent_id,
|
|
|
+ d.node_name AS title,
|
|
|
+ d.id AS "value",
|
|
|
+ d.id AS "key",
|
|
|
+ d.major_data_type AS "majorDataType",
|
|
|
+ d.display_hierarchy AS "displayHierarchy",
|
|
|
+ d.is_storage_node AS "isStorageNode",
|
|
|
+ d.post_type AS postType,
|
|
|
+ d.project_type,
|
|
|
+ d.storage_type,
|
|
|
+ d.ext_type,
|
|
|
+ d.ext_id,
|
|
|
+ d.archive_auto_type,
|
|
|
+ d.archive_auto_node_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"
|
|
|
+ FROM
|
|
|
+ m_archive_tree_contract d
|
|
|
+ WHERE
|
|
|
+ d.parent_id = #{parentId} AND d.is_deleted = 0 and project_id = #{projectId}
|
|
|
+ <if test="tenantId!=null and tenantId!=''">
|
|
|
+ AND d.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ ORDER BY d.sort
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="tree" resultMap="treeNodeResultMap">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ parent_id,
|
|
|
+ node_name AS title,
|
|
|
+ id AS "value",
|
|
|
+ id AS "key",
|
|
|
+ major_data_type AS "majorDataType",
|
|
|
+ display_hierarchy AS "displayHierarchy",
|
|
|
+ is_storage_node AS "isStorageNode",
|
|
|
+ is_upload_file_display_configuration_tree AS "isDisplayTree",
|
|
|
+ is_built_drawing AS "isBuiltDrawing",
|
|
|
+ post_type AS postType,
|
|
|
+ project_type,
|
|
|
+ storage_type,
|
|
|
+ ext_type,
|
|
|
+ ext_id,
|
|
|
+ archive_auto_type,
|
|
|
+ archive_auto_node_id
|
|
|
+ FROM m_archive_tree_contract
|
|
|
+ WHERE is_deleted = 0 and project_id = #{projectId}
|
|
|
+ <if test=" tenantId!=null and tenantId!='' ">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test=" disPlayTree!=null and disPlayTree!='' ">
|
|
|
+ AND is_upload_file_display_configuration_tree = 1
|
|
|
+ </if>
|
|
|
+ <if test=" nodeType !=null and nodeType !='' ">
|
|
|
+ /*根节点=0 关联电子原生文件=1 数字化上传文件=2*/
|
|
|
+ AND node_type in (0,#{nodeType})
|
|
|
+ </if>
|
|
|
+ OR parent_id = 0
|
|
|
+ ORDER BY sort
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="lazyTree2" resultMap="ArchiveTreeContractVO2ResultMap">
|
|
|
+ SELECT
|
|
|
+ d.id,
|
|
|
+ d.parent_id,
|
|
|
+ d.node_name AS title,
|
|
|
+ d.id AS "value",
|
|
|
+ d.id AS "key",
|
|
|
+ d.major_data_type AS "majorDataType",
|
|
|
+ d.display_hierarchy AS "displayHierarchy",
|
|
|
+ d.is_storage_node AS "isStorageNode",
|
|
|
+ d.post_type AS postType,
|
|
|
+ d.project_type,
|
|
|
+ d.storage_type,
|
|
|
+ d.ext_type,
|
|
|
+ d.ext_id,
|
|
|
+ d.archive_auto_type,
|
|
|
+ d.archive_auto_node_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"
|
|
|
+ FROM
|
|
|
+ m_archive_tree_contract d
|
|
|
+ WHERE
|
|
|
+ d.parent_id = #{parentId} AND d.is_deleted = 0 and project_id = #{projectId}
|
|
|
+ <if test="tenantId!=null and tenantId!=''">
|
|
|
+ AND d.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ ORDER BY d.sort
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="tree2" resultMap="ArchiveTreeContractVO2ResultMap">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ parent_id,
|
|
|
+ node_name AS title,
|
|
|
+ id AS "value",
|
|
|
+ id AS "key",
|
|
|
+ major_data_type AS "majorDataType",
|
|
|
+ display_hierarchy AS "displayHierarchy",
|
|
|
+ is_storage_node AS "isStorageNode",
|
|
|
+ is_upload_file_display_configuration_tree AS "isDisplayTree",
|
|
|
+ is_built_drawing AS "isBuiltDrawing",
|
|
|
+ post_type AS postType,
|
|
|
+ project_type,
|
|
|
+ storage_type,
|
|
|
+ ext_type,
|
|
|
+ ext_id,
|
|
|
+ archive_auto_type,
|
|
|
+ archive_auto_node_id
|
|
|
+ FROM m_archive_tree_contract
|
|
|
+ WHERE is_deleted = 0 and project_id = #{projectId}
|
|
|
+ <if test=" tenantId!=null and tenantId!='' ">
|
|
|
+ AND tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test=" disPlayTree!=null and disPlayTree!='' ">
|
|
|
+ AND is_upload_file_display_configuration_tree = 1
|
|
|
+ </if>
|
|
|
+ <if test=" nodeType !=null and nodeType !='' ">
|
|
|
+ /*根节点=0 关联电子原生文件=1 数字化上传文件=2*/
|
|
|
+ AND node_type in (0,#{nodeType})
|
|
|
+ </if>
|
|
|
+ OR parent_id = 0
|
|
|
+ ORDER BY sort
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|