Two ways come to mind:
1) Put in a double pole, double throw relay with a 12V coil with the coil and normally closed contacts supplied by the 12V power supply. Connect the battery to the normally open contacts. Connect the pump to the relay common terminals. When the shore power has the power supply on, it will pull in the relay and power the pump from the power supply, no load on the battery. When the shore power disconnects, the relay drops out and the battery feeds the pump.2) Use a power supply with about 15V of output. Connect the + on the power supply to the anode of a diode that will handle the pump current load. Connect the + from the battery to the anode of another diode (similar size to the first one). Connect the two cathodes of the diodes together and connect to the + side of the pump. Connect the negative of the power supply, battery and pump together. When the power supply is on, it will have a higher voltage than the battery (around 13V - 14V) and the diode between the power supply and the pump will conduct. The higher voltage on the cathode of the diode to the battery will switch it off, isolating the battery. When the shore power supply is off, the voltage on two cathodes of the diodes will drop until they are lower than the battery + voltage and the diode between the battery and the pump will conduct. The diode to the power supply will be off.
Method 1 is obvious how it works and is not dependent on the voltage of the power supply being above (at least 1.2V) the max battery voltage (with the engine off).
Method 2 has no moving parts. Take yer pick.
BobH