The present invention relates to a class of substituted triazolopiperazine compounds represented by formula ( I ), tautomers, enantiomers, diastereomers, racemates, metabolites, metabolic precursors, and pharmaceutically acceptable salts, esters, prodrugs or hydrate thereof, a preparation methods therefor, intermediates and a use thereof in the preparation of drugs for prevention and treatment of diseases associated with PARP including various ischemic diseases, neurodegenerative diseases and cancers.