The present invention relates to the technical field of pharmacy, and specifically relates to a compound as represented by formula (I), and a pharmaceutically acceptable salt, an ester or stereoisomers thereof. R1, X1, X2, M, Ar, ring A, ring B, and L are as defined in the description. The present invention further relates to a method for preparing the compound, and the pharmaceutically acceptable salt, the ester or the stereoisomers thereof, a pharmaceutical composition and a pharmaceutical preparation comprising the compound, and the pharmaceutically acceptable salt, the ester or the stereoisomers thereof, and an application of the compound, and the pharmaceutically acceptable salt, the ester or the stereoisomers thereof in preparation of a drug for treating and/or preventing an FXR receptor-mediated disease.