Mesa man gets 22-year prison term in hammer death