Global dynamics of a general Lotka-Volterra competition-diffusion system in heterogeneous environments