The present invention relates to the field of pharmaceutical chemistry, specifically to a class of compounds containing lactam and derivative thereof, and especially to a pyridine derivative as shown in general formula (I), preparation method and the use thereof as a Factor Xa inhibitor. The present invention further relates to the medical use of the compound and derivative thereof in preparation of anticoagulant drugs, particularly to the use in preparation of drugs for preventing or treating thrombosis or embolism.