Agricultural irrigation requires significant consumption of freshwater resources and energy. The integration of photovoltaic power generation into irrigation systems has been extensively investigated in order to save the cost of energy. However, current research often neglects the coupling relationship between photovoltaic power generation and irrigation schemes. This study presented a novel smart integrated photovoltaic pump station system to effectively address the issue associated with water and energy consumption in irrigation. An optimization model was proposed to synchronize the energy consumption of irrigation pump stations with photovoltaic power generation, accurately meeting the irrigation water demand while maximizing solar energy utilization. The optimization model incorporates power balance, grid-connected power, and total water demand as constraints while considering pump speed as the decision variable and aiming to minimize daily operational costs. Finally, a high-standard farmland was used as a case study to validate the efficacy of the optimization strategy through two photovoltaic grid-connected policies—one allowing for the sale of surplus power and the other prohibiting it. An improved dynamic programming method was employed to solve for optimal energy consumption schemes under different water demand conditions; the results were compared against traditional methods, revealing potential cost savings ranging from 6.2% to 30.5%. The optimization model and method propose a new operational concept for the irrigation system with photovoltaic generation, effectively utilizing the distinctive features of both irrigation and photovoltaics to optimize water and energy resources.