An N-(azaaryl)cyclolactam-1-carboxamide derivative having a structure of formula (1), a preparation method therefor, and a use thereof, each substituent being defined in the description and claims. The compound can be widely applied to the preparation of medicaments for treating cancer, tumor, autoimmune diseases, metabolic diseases, or metastatic diseases, in particular for treating ovarian cancer, pancreatic cancer, prostate cancer, breast cancer, cervical cancer, glioblastoma, multiple myeloma, metabolic diseases, neurodegenerative diseases, metastasis of primary tumor sites, or bone metastatic cancer, and is expected to be developed into CSF1R inhibitor drugs.