delete from m_archive_tree_contract where contract_id = #{contractId} and is_deleted = 0 and FIND_IN_SET(#{id},ancestors) > 0 delete from u_archive_file where contract_id = #{contractId} and node_id in ( select id from m_archive_tree_contract where contract_id = #{contractId} and is_deleted = 0 and FIND_IN_SET(#{id},ancestors) > 0 ) UPDATE m_archive_tree_contract SET is_upload_file_display_configuration_tree = 1 WHERE id IN #{diffRent} AND is_deleted = 0 AND status = 1 UPDATE m_archive_tree_contract SET is_upload_file_display_configuration_tree = 0 WHERE id IN #{diffRent} AND is_deleted = 0 AND status = 1 UPDATE m_archive_tree_contract SET is_upload_file_display_configuration_tree = 0 WHERE node_type = 2 AND is_deleted = 0 AND status = 1 update m_archive_tree_contract set archive_auto_node_id = #{archiveAutoNodeId} where is_deleted = 0 and ancestors like concat('', #{ancestors}, '%'); update m_archive_tree_contract set archive_auto_type= #{archiveAutoType} where is_deleted = 0 and ancestors like concat('', #{ancestors}, '%') and archive_auto_group_id = #{archiveAutoGroupId} and archive_auto_type = 2 and archive_auto_group_select = 0 ; update m_archive_tree_contract set archive_auto_type= #{archiveAutoType} ,archive_auto_group_id=#{archiveAutoGroupId}, archive_auto_group_select=0 ,file_number_prefix = #{fileNumberPrefix} where is_deleted = 0 and ancestors like concat('', #{ancestors}, '%') /*最高并卷规则不能覆盖 分类并卷规则,单独组卷规则*/ and (archive_auto_type != 2 and archive_auto_type != 3 or archive_auto_type is null) update m_archive_tree_contract set node_name = #{name} where node_name = #{contractName} and contract_id = #{id} update u_archive_file sort = #{item.sort}, pdf_file_url = #{item.pdfFileUrl}, e_visa_file = #{item.eVisaFile}, file_page = #{item.filePage}, file_size = #{item.fileSize}, is_certification = 1, certification_time = #{item.certificationTime}, file_time = #{item.fileTime} where id = #{item.id} INSERT INTO m_archive_tree_contract (id, tenant_id, project_id, contract_id, parent_id, ancestors, node_name, full_name, tree_code, ext_type, ext_id, ext_key_id, ext_attach_id, sort, status, is_deleted, from_id, node_type, is_storage_node, post_type, major_data_type, project_type, storage_type, create_user, create_dept, create_time, tree_structure) VALUES (#{item.id}, #{item.tenantId}, #{item.projectId}, #{item.contractId}, #{item.parentId},#{item.ancestors}, #{item.nodeName},#{item.fullName},#{item.treeCode},#{item.extType},#{item.extId},#{item.extKeyId},#{item.extAttachId}, #{item.sort},#{item.status},#{item.isDeleted},#{item.fromId},#{item.nodeType},#{item.isStorageNode},#{item.postType},#{item.majorDataType} ,#{item.projectType},#{item.storageType},#{item.createUser},#{item.createDept},#{item.createTime}, #{item.treeStructure}) update m_archive_tree_contract set is_deleted = #{isDeleted}, update_time = NOW() where id in #{id} update m_archive_tree_contract parent_id = #{item.parentId}, ancestors = #{item.ancestors}, node_name = #{item.nodeName}, node_type = #{item.nodeType}, full_name = #{item.fullName}, tree_structure = #{item.treeStructure}, update_time = NOW() where id = #{item.id} update m_archive_tree_contract file_number_prefix = #{node.fileNumberPrefix}, storage_time = #{node.storageTime}, rollor = #{node.rollor}, reviewer = #{node.reviewer}, specification = #{node.specification}, archive_name_suffix = #{node.archiveNameSuffix} where is_deleted = 0 and project_id = #{node.projectId} and FIND_IN_SET(#{node.id},ancestors) > 0