Add a new rule like this:
RewriteEngine On
RewriteRule ^bar(/|$) https://bar.foo.com/ [NC,R=301,L]
QUERY_STRING
will automatically be carried over to target URI.
Make sure there is no trailing ?
in the target URI which strips existing query string.