Phenotypic plasticity is the property of a given genotype to produce multiple phenotypes in response to changing environmental conditions. Understanding the genetic basis of phenotypic plasticity and establishing a predictive model is highly relevant for future agriculture under changing climate. Here, we report findings on the genetic basis of phenotypic plasticity for 23 complex traits using a maize diverse population, planted at five sites with distinct environmental conditions and genotyped with ~ 6.60 million SNPs. We found that altitude-related environmental factors were main drivers for across site variation in flowering time traits but not plant architecture and yield traits. For 23 traits, we detected 109 QTLs, of which 29 was for mean, 66 was for plasticity, and 14 for both parameters, besides, 80% of the QTLs were interreacted with the environment. The effects of several QTLs changed in magnitude or sign, driving variation in phenotype plasticity, and we further experimentally validated one plastic gene ZmTPS14.1 whose effect was likely mediated by the compensation effect of ZmSPL6 which was from the downstream pathway probably. By integrating genetic diversity, environmental variation, and their interaction in a joint model, we could provide site-specific predictions with increased accuracy by as much as 15.5%, 3.8%, and 4.4% for DTT, PH, and EW, respectively. Overall, we revealed a complex genetic architecture involving multiallelic, pleiotropy, and genotype by environment interaction underlying maize complex trait mean and plasticity variation. Our study thus provided novel insights into the dynamic genetic architectures of agronomic traits in response to changing environments, paving a practical route to precision agriculture.