Maintenance strategy and spare parts allocation of wind turbines are two important aspects of maintenance optimization of offshore wind farms. Aiming at the problem of joint optimization of maintenance strategy and spare parts for offshore wind turbines, this paper puts forward a comprehensive maintenance optimization strategy for gearbox, which takes both off-line maintenance and recycling of components into account. On the basis of this strategy, combined with the deterioration process of wind turbine components and the accessibility constraints of offshore maintenance, an optimization model is established, which takes operation and maintenance variables and spare parts variables as decision variables and takes the minimum average cost rate per unit time as objective. The optimization problem is solved by combining genetic algorithm with Monte Carlo simulation. The results show that the integrated maintenance strategy can effectively improve the availability of components and reduce the cost of operation and maintenance, which verifies the effectiveness of the integrated maintenance optimization strategy.