select ownerid
     , REPLACE(fdocument, '.' + postfix, '') as fdocument
     , postfix
     , fobsurl
     , fobsurl_minimage
     , fobsurl_compressimage
     , fobsurl_hls
     , createdate
     , contentlength
from tattachment
where ownertable =$ownertable$ and ftype=$ftype$ and siteid=$siteid$ and ownerid in $ownerid$
order by tattachmentid