We consider bosonic atoms loaded into optical lattices with cavity-mediated infinite-range interactions. Competing short-and global-range interactions cultivates a rich phase diagram. With a systematic field-theoretical perspective, we present an analytical construction of global ground-state phase diagram. We find that the infinite-range interaction enhances the fluctuation of the number density. In the strong coupling regime, we find four branches of elementary excitations with two being "partilce-like" and two being "hole-like", and that the excitation gap becomes soft at the phase boundary between compressible phases and incompressible phases. We derive an effective theory describing compressible superfluid and supersolid states. To complement this perturbative study, we construct a self-consistent mean-field theory and find numerical results consistent with our theoretical analysis. We map out the phase diagram and find that a charge density wave may undergo a structure phase transition to a different charge density wave before it finally enters into the supersolid phase driven by increasing the hopping amplitude.