The present invention relates to a thienopyrimidine derivative and use thereof in medicine, and also to a pharmaceutical composition containing the compound. The compound or pharmaceutical composition is used for inhibiting acetyl-CoA carboxylase (ACC). The present invention also relates to a method of preparing such compound and pharmaceutical composition, as well as their use in the treatment or prevention of diseases regulated by acetyl-CoA carboxylase in mammals, especially in humans.