The present invention relates to a dihydropyrimidine compound having an antiviral activity, a pharmaceutical composition comprising same, a preparation method therefor and the uses thereof in the prevention or treatment of viral diseases including, but not limited to, Hepatitis A, Hepatitis B, Hepatitis C, influenza, herpes and acquired immunodeficiency syndrome (AIDS).