I am looking for an example of a commutative ring with $1$, in which every ideal is generated by a single element, for which the conclusion of the structure theorem for finitely generated modules is wrong. (The ring is allowed to have zero divisors, so it is not a PID).
Are there any examples? What happens if one drops the other conditions instead (commutativity, $1\in R$)? Does then the structure theorem still fail ?