A compound represented by formula, a pharmaceutically acceptable salt, or a hydrate thereof, wherein, R 1 is selected from X is selected from single bond, O and S; Y and Z are each independently selected from N and CH; ring A is selected from 5-10 membered aryl and 5-10 membered heteroaryl; R 2 is selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 3 is selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 4 and R 5 are each independently selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 6 is selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R is selected from H, F, Cl, Br, I, OH, CN, NH 2, COOH, C(=O)NH 2, or the group consisting of C 1-8 alkyl, C 1-8 heteroalkyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl and C 3-6 cycloalkyl-C 1-3 alkyl-, each of which is optionally substituted with 1, 2, or 3 R'; n is selected from 0, 1, 2, 3 and 4; m is selected from 0, 1, 2, 3 and 4; P is selected from 0, 1, 2 and 3; or, when m is 2, R 3 and R 3 are connected together to form a 5-6 membered ring; R' is selected from the group consisting of F, Cl, Br, I, OH, CN, NH 2, COOH, Me, Et, CF 3, CHF 2, CH 2 F, NHCH 3 and N(CH 3) 2; "hetero" represents a heteroatom or a heteroatom group, which is selected from the group consisting of -C(=O)N -, -N -, -S(=O) 2 N -, -S(=O) N -, -O-, -S-, =O, =S, -O-N=, -C(=O)O-, -C(=O) -, -C(=S)-, -S(=O)-, -S(=O) 2 - and -N C(=O)N -; in any of the above cases, the number of the heteroatom or the heteroatom group is independently selected from 1, 2 and 3. R 1 is selected from X is selected from single bond, O and S; Y and Z are each independently selected from N and CH; ring A is selected from 5-10 membered aryl and 5-10 membered heteroaryl; R 2 is selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 3 is selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 4 and R 5 are each independently selected from H, halogen, CN, NO 2, OH, COOH, NH 2, or the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R 6 is selected from the group consisting of C 1-6 alkyl, C 1-6 heteroalkyl, C 3-6 cycloalkyl and 3-6 membered heterocycloalkyl, each of which is optionally substituted with 1, 2, or 3 R; R is selected from H, F, Cl, Br, I, OH, CN, NH 2, COOH, C(=O)NH 2, or the group consisting of C 1-8 alkyl, C 1-8 heteroalkyl, C 3-6 cycloalkyl, 3-6 membered heterocycloalkyl and C 3-6 cycloalkyl-C 1-3 alkyl-, each of which is optionally substituted with 1, 2, or 3 R'; n is selected from 0, 1, 2, 3 and 4; m is selected from 0, 1, 2, 3 and 4; P is selected from 0, 1, 2 and 3; or, when m is 2, R 3 and R 3 are connected together to form a 5-6 membered ring; R' is selected from the group consisting of F, Cl, Br, I, OH, CN, NH 2, COOH, Me, Et, CF 3, CHF 2, CH 2 F, NHCH 3 and N(CH 3) 2; "hetero" represents a heteroatom or a heteroatom group, which is selected from the group consisting of -C(=O)N -, -N -, -S(=O) 2 N -, -S(=O) N -, -O-, -S-, =O, =S, -O-N=, -C(=O)O-, -C(=O) -, -C(=S)-, -S(=O)-, -S(=O) 2 - and -N C(=O)N -; in any of the above cases, the number of the heteroatom or the heteroatom group is independently selected from 1, 2 and 3.