Concatenate string in SQL instead of PHP, use doctrine to construct concat expression

backport of https://github.com/owncloud/core/pull/4799

@jancborchardt @DeepDiver1975 @kabum