We give a general theory of decompositions of semigroups with zero into an orthogonal, right, left and matrix sum of semigroups. The lattices of such decompositions are characterized by some sublattices of the lattice of equivalence relations on a semigroup with zero, and also by some lattices obtained from the lattices of (left, right) ideals of a semigroup with zero. Using the obtained results we decompose the lattice of (left, right) ideals of a semigroup with zero into a direct product of directly indecomposable lattices.