Disclosed are a fused pyrimidine compound as represented by formula I, pharmaceutically acceptable salt, hydrate or solvate thereof, an optical isomer or a prodrug thereof, as well as a preparation method, an intermediate, a composition and uses thereof. The fused pyrimidine compound according to the present invention can inhibit activity of PI3 kinase, and can be used to treat diseases such as cancer caused by abnormal activity of the PI3 kinase, or can be used to prepare medicine for treating these diseases.