UPDATE ta_housing_resources t SET t.real_heat = t.real_heat + 1 WHERE t.house_id = #{houseId} AND t.real_heat >= 0 UPDATE ta_housing_resources t SET t.real_heat = t.real_heat - 1 WHERE t.house_id = #{houseId} AND t.real_heat > 0