The present invention falls within the technical field of medicine, and in particular relates to PDE9 inhibitor compounds as shown in formula (I) or pharmaceutically acceptable salts or stereoisomers thereof, and also relates to pharmaceutical preparations and pharmaceutical compositions of the compounds and the uses thereof. X1, X2, X3, X4, R1, R2, ring A, L and m are as defined in the description. The compounds can be used to prepare drugs for treating or preventing related diseases mediated by PDE9.