If a base get attacked, and its defenses damaged, that base production will not get the bonus from barracks if it is damaged.
And if the damage is above 50%, it will not possible to build marines at all until the damage is repaired bellow 50%.
Even if you can't keep the occupations, by damaging your enemy defenses you'll criple their production capacity!
And watch for their repair ships, if they try to use it to increase the repair speed, attack again to kill those easy to smash ships