Disclosed are a PI3Kdelta inhibitor compound of formula (I), pharmaceutically acceptable salts, stereoisomers or deuterated compounds thereof, preparation methods of these compounds, a pharmaceutical preparation containing these compounds, and the use thereof for preparing a medicine for treating inflammatory disorders or tumours.