MAYA-some render problems

I met some render problems on this week.

How do i render my model and background separate? or i can just render model and composite them together on Nuke? Because when i render model with background,the machine’s shadow is blocking the wall and part of machine overlay the wall.

then i slove it on next week.