update u_archives_auto set node_id = #{nodeId},tree_sort = #{nodeSort} where id in #{id} /**把未锁定案卷的文件关联去掉*/ update u_archive_file set archive_id = null, is_archive=0 where is_deleted = 0 and archive_id in ( select id from u_archives_auto where project_id = #{projectId} and is_auto_file !=1 and is_deleted=0 and is_lock!=1 ); /**把未锁定案卷去掉*/ update u_archives_auto set is_deleted=1 where project_id = #{projectId} and is_auto_file!=1 and is_deleted=0 and is_lock!=1; update u_archive_file set archive_id = null, is_archive=0 WHERE is_deleted = 0 AND archive_id IN ( select id from u_archives_auto where project_id = #{projectId} and is_auto_file!=1 and is_deleted=0 and is_lock!=1 and node_id in ( SELECT id FROM m_archive_tree_contract WHERE project_id = #{projectId} AND ( contract_id is null OR tree_code = #{treeCode} ) AND ( contract_id = #{contractId} OR tree_code = #{treeCode} ) ) ); update u_archives_auto set is_deleted=1 where project_id = #{projectId} and is_auto_file!=1 and is_deleted=0 and is_lock!=1 and node_id in ( SELECT id FROM m_archive_tree_contract WHERE project_id = #{projectId} AND ( contract_id is null OR tree_code = #{treeCode} ) AND ( contract_id = #{contractId} OR tree_code = #{treeCode} ) ); update u_archive_file set archive_id = null, is_archive=0 WHERE is_deleted = 0 AND archive_id IN ( SELECT id FROM u_archives_auto WHERE project_id = #{projectId} AND is_auto_file != 1 AND is_deleted = 0 AND is_lock != 1 AND node_id IN ( SELECT id FROM m_archive_tree_contract WHERE is_deleted = 0 AND project_id = #{projectId} AND ancestors IS NOT NULL AND ancestors LIKE concat('' , #{ancestors} , '%') OR id = #{nodeId} ) ); update u_archives_auto set is_deleted=1 where project_id = #{projectId} AND is_auto_file != 1 AND is_deleted = 0 AND is_lock != 1 AND node_id IN ( SELECT id FROM m_archive_tree_contract WHERE is_deleted = 0 AND project_id = #{projectId} AND ancestors IS NOT NULL AND ancestors LIKE concat('' , #{ancestors} , '%') OR id = #{nodeId} ); update u_archive_file set is_archive = 0 ,archive_id = null where id in #{id} update u_archives_auto set is_deleted = 1 ,is_destroy = 1 ,update_user = #{userId} where id in #{id}