The net primary productivity (NPP) of vegetation is the key indicator for assessing ecosystem productivity and carbon cycling. The Ulan Mulun River Basin (UMRB) in Northwest China is a typical coal mining area, including open-pit mining (OPM) and underground coal mining (UGM). There are limited studies utilizing long-term, high-resolution data to investigate the spatiotemporal and driving mechanisms of NPP in different types of mining and non-coal mining (NCM) areas. In this study, NPP was estimated using high-resolution Landsat data (30 m) and an improved CASA model for the period 1987–2022. The spatiotemporal variations in NPP across the basin were systematically investigated using Theil–Sen–MK trend analysis, partial derivatives, and multivariate regression residual to explore and quantify the impacts of climate variability (CV) and human activities (HAs) on the different coal mining and NCM areas. The research results show that the overall fluctuating upward trend of vegetation cover in the country is 64.84% during the period from 1987 to 2022. However, there is a decreasing trend of NPP in the coal mining areas. Precipitation was the major factor influencing the change in NPP (21.835 gC/m2/a), while HAs had a lesser effect (4.667 gC/m2/a). In addition, UGM and NCM were more positively affected by HAs than OPM, while OPM was more positively affected by CV than UGM and NCM. These findings can guide scientific ecological restoration strategies, assess carbon balance impacts, and optimize land management and planning in mining areas to achieve a balance between resource development and environmental protection.