供需列表查询.sql 484 B

12345678910111213141516
  1. select
  2. t1.tsupplyanddemandid,
  3. t1.fissupply,
  4. t1.ftype,
  5. t1.ftitle,
  6. t1.fcontent,
  7. t1.fstatus,
  8. t1.checkdate,
  9. t1.fenddate,
  10. t2.fagentname,
  11. t1.freadtimes,
  12. t1.tenterprise_userid,
  13. (select count(0) from timdialog where siteid=t1.siteid and ownertable='tsupplyanddemand' and ownerid=t1.tsupplyanddemandid) as fcommunicationtimes
  14. from tsupplyanddemand t1
  15. inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
  16. where t1.siteid=$siteid$ and t1.fstatus not in ('н¨') and $where$