Provided are a compound represented by formula (III) or pharmaceutically acceptable salts, solvates, active metabolites, polymorphs, esters, tautomers or prodrugs thereof, pharmaceutical compositions containing the compound represented by formula (III), and the application of the pharmaceutical compositions as selective inreversible inhibitor of Bruton's tyrosine kinase for the prevention and treatment of inflammation, autoimmune diseases (such as rheumatoid arthritis) associated with aberrant B cell proliferation and cancers.