select t1.tagentsid,
       t1.siteid,
       t1.createby,
       t1.createdate,
       t1.changeby,
       t1.changedate,
       t1.fagentnum,
       t1.fagentname,
       t1.fagentshortname,
       t1.fprovince,
       t1.fcity,
       t1.fcounty,
       t1.faddress,
       t1.fcontact,
       t1.fphonenumber,
       t1.fwechatno,
       t1.femail,
       t1.fdutyparagraph,
       t1.fbirthdate,
       t1.fpayment,
       t1.fjoindate,
       t1.fteamsize,
       t1.fbegdate,
       t1.fenddate,
       t1.fcooperationstatus,
       t1.fsaleruserid,
       t2.fname as fsaler,
       t1.fappmodel,
       t1.ftype
from tagents t1
         left join tenterprise_users t2 on t1.siteid = t2.siteid and t1.fsaleruserid = t2.tenterprise_userid
where t1.siteid =$siteid$ and t1.tagentsid=$tagentsid$