供需详情查询.sql 683 B

123456789
  1. select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
  2. t1.ftype, t1.fstatus, t1.checkby, t1.checkdate,
  3. t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
  4. t4.fagentname as fcooperationagentname,10 as fcommunicationtimes,t1.fcontent,t1.tenterprise_userid
  5. from tsupplyanddemand t1
  6. inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
  7. inner join tenterprise_users t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
  8. left join tagents t4 on t1.siteid=t4.siteid and t1.tcooperationagentsid=t4.tagentsid
  9. where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and tsupplyanddemandid=$tsupplyanddemandid$