update nc_doc_file set delete_flag=1 where doc_id in (select distinct doc_id from nc_doc_relative where attribution_type = #{attrType} and attribution_id=#{attrId}) delete from nc_doc_file where doc_id = #{docId}