I've...gone through a similar thing a while back. I've had history with depression going back years, and on a rational level I knew that it was depression speaking but hell if you can do anything about it even if you realise what's going on right. I like my work so I was working like 12 hours a day, feeling both accomplished and resentful that others were doing less and they dared to have a life. I ended up on pills (again) and when those ran out I've become essentially a high-functioning alcoholic so I feel like I'm the LAST person who should advise anyone on how to cope with capitalism.... YET here I am.
How I deal with this is, letting go, essentially. You care about the good of the company but fuck if they care about you. Sure, do your job right, but don't think about it as a way to help the company, just as a way to personal accomplishment? Use the job as a way to learn new skills, earn new experience, basically to get new tools for the rest of your life.
When I entered the workforce, so to speak, I had my head full of "do what you love and you'll never have to work a day in your life" and then I met this girl who told me: I love Russian, that's why I decided not to major in it in college and it lit a lightbulb over my head. It doesn't work for everyone, turning your passion into your job. For me, work is work, but I draw a hard line after coming home.
/I'm also, surprise surprise, drunk atm so take this with a grain of salt. I really hope I didn't totally misunderstood you and actually accidentally insulted you or sth =.=/