g | x | w | all
Bytes Lang Time Link
103Python 2241218T225534Zsquarero
099Perl 5 pa241218T232325ZXcali
057Japt160206T175801ZETHprodu
069Retina160207T122004Zrandomra
134PHP160206T222129ZPaper
5367𝔼𝕊𝕄𝕚𝕟160206T230217ZMama Fun
055Pyth160206T194012ZPurkkaKo
102C160206T191958Zyyny
101Haskell160206T191830Zyyny
080JavaScript ES6160206T181550ZETHprodu

Python 2, 103 bytes

-1 byte by moving to Python 2.

lambda x,s='|__|__|',t='   ____':x*' 'and(x>1and['_'*7,t,s,' __|__|'][x%2::2]+~-x/2*[s]or[t,'   |__|'])

Try it online!

Python 3.8 (pre-release), 105 bytes

-2 bytes by using f-strings.

lambda x:((a:=-~x//2)>0)*[f"{(7-x%2*3)*'_':>7}",*zip(x%2*' '+x//2*'|',*[a*i for i in'_ '[x<2]*2+'|__|'])]

Try it online!

Perl 5 -pa, 99 bytes

$\=$\."|__|__|
",$F[0]-=2while"@F">1;$_=$_&&(@F">0?"   ____
 ".($_>1?'__':"  ")."|__|
":"_______
")

Try it online!

Japt, 60 57 bytes

U%2?[S³'_²²RSU¥1?S²:'_²"|__|"]¬:U?'_p7 :P +"
|__|__|"pU/2

Just a basic answer. Can probably be improved. Test it online!

Retina, 69 bytes

r`(1?)1
$1__|__|¶
^__(?=\D{5}$)

^.
$0____¶ $0
^\D

^1
___
 ?1
|

Takes input in unary.

Try it online here.

PHP, 134 chars

<?$i=$argv[1];if($i>0){echo($i%2===0?"_______\n|__":"   ____\n".($i>1?"___":"   "))."|__|\n";echo str_repeat("|__|__|\n",($i-1)/2);}?>

Notes:

𝔼𝕊𝕄𝕚𝕟, 53 chars / 67 bytes

ï%2?`   ⟮__⟯Ⅰ
 ⦃ï<2?⍞  :⍞Ⅰ⦄|Ⅰ|`:ï?⍘_ď7:⬯⦄
|Ⅰ|Ⅰ|`ď ï/2

Try it here (Firefox only).

This is quite similar to the Javascript ES6 answer, even though I found it independently. Explanation to come when I finish golfing.

Pyth, 55 bytes

K"|__|"IQ>7<*3%Q2r"3 7_"9?tQjb+XW%Q2J+KtKZd*/tQ2]J+*3dK

Try it online. Test suite.

This is really quick and dirty, written on my phone. Will get to more golfing later.

C, 104 102 bytes

f(x){x?x%2?printf("   ____\n%3s|__|\n",x<2?"":"__"):puts("_______"):0;for(x/=2;x>0;x--)puts("|__|__|");}

Maybe I can use some printf trickery to improve this...
Apparently I can

Haskell, 101 bytes

Haskell has never been great for code golfing...

b="\n|__|__|"
h="   ____\n "
f 1=h++"  |__|"
f 2="_______"++b
f 3=h++"__|__|"++b
f n=f(n-2)++b
f _=""

JavaScript ES6, 80 bytes

x=>(x%2?`   ____
 ${x<2?"  ":"__"}|__|`:x?"_______":"")+`
|__|__|`.repeat(x/2)

Uses the same technique as my Japt answer, and is surprisingly not much longer...