Piecewise noetherian rings