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

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