A piperazinotriazole compound as shown in formula I, or tautomers, stereoisomers or optical isomers thereof, or pharmaceutically acceptable salts, esters or hydrates thereof, wherein each of A and B independently is a hydrogen or a substituted or unsubstituted C1-C8 hydrocarbonyl, and not both of A and B are hydrogen, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl and an amino, or, A and B together with carbon atoms connecting to them form a substituted or unsubstituted C4-C8 aliphatic ring, a substituted or unsubstituted C6-C10 aromatic ring, a substituted or unsubstituted 4-8 membered heterocyclic ring containing one to three atoms selected from N, O or S, or a substituted or unsubstituted 5-8 membered heteroaromatic ring containing one to three atoms selected from N, O or S, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl and an amino, X is a hydrogen, a halogen, a hydroxyl or a cyano, Y is a hydrogen or a substituted or unsubstituted C1-C8 alkyl, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl, an amino, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C2-C6 alkoxy carbonyl, a C2-C6 alkenyl, and a C2-C6 alkynyl, G is a hydrogen, a C1-C6 alkyl, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C1-C6 alkyl amino or a (C1-C6 alkyl) 2 amino, Z is a hydrogen, a C1-C6 alkyl, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C1-C6 alkyl amino or a (C1-C6 alkyl) 2 amino, and not all of Y, G and Z are hydrogen, R is selected from a hydrogen or a substituted or unsubstituted C1-C8 alkyl, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl, an amino, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C2-C6 alkoxy carbonyl and a C6-C10 aryl. wherein each of A and B independently is a hydrogen or a substituted or unsubstituted C1-C8 hydrocarbonyl, and not both of A and B are hydrogen, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl and an amino, or, A and B together with carbon atoms connecting to them form a substituted or unsubstituted C4-C8 aliphatic ring, a substituted or unsubstituted C6-C10 aromatic ring, a substituted or unsubstituted 4-8 membered heterocyclic ring containing one to three atoms selected from N, O or S, or a substituted or unsubstituted 5-8 membered heteroaromatic ring containing one to three atoms selected from N, O or S, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl and an amino, X is a hydrogen, a halogen, a hydroxyl or a cyano, Y is a hydrogen or a substituted or unsubstituted C1-C8 alkyl, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl, an amino, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C2-C6 alkoxy carbonyl, a C2-C6 alkenyl, and a C2-C6 alkynyl, G is a hydrogen, a C1-C6 alkyl, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C1-C6 alkyl amino or a (C1-C6 alkyl) 2 amino, Z is a hydrogen, a C1-C6 alkyl, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C1-C6 alkyl amino or a (C1-C6 alkyl) 2 amino, and not all of Y, G and Z are hydrogen, R is selected from a hydrogen or a substituted or unsubstituted C1-C8 alkyl, in which the substituent for substitution is selected from a group consisting of a halogen, a cyano, a nitro, a hydroxyl, an amino, a C1-C6 alkoxy, a C2-C6 alkyl carbonyl, a C2-C6 alkoxy carbonyl and a C6-C10 aryl.