DELETE t2 FROM qc_type t1, qc_type_cases_entry t2 WHERE t1.hospital_id = #{hospitalId} AND t1.id = t2.type_id AND t2.case_entry_id = #{entryId}