商户档案列表查询.sql 978 B

123456789101112131415161718192021222324252627282930313233
  1. select t1.siteid,
  2. t1.sys_enterpriseid,
  3. t1.createby,
  4. t1.createdate,
  5. t1.changeby,
  6. t1.changedate,
  7. t1.city,
  8. t1.county,
  9. t1.address,
  10. t1.phonenumber,
  11. t1.province,
  12. t1.contact,
  13. t1.enterprisename,
  14. t1.taxno,
  15. t1.limitreturnday,
  16. t1.freefreightamount,
  17. t1.latitude,
  18. t1.longitude,
  19. t1.invoicingpoint,
  20. t1.saleclassauth,
  21. t1.grade,
  22. t1.isorder,
  23. t1.idcard,
  24. t2.sa_customersid,
  25. t2.type,
  26. t3.agentnum,
  27. t9.erpagentnum
  28. from sys_enterprise t1
  29. LEFT JOIN sa_customers t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid and t1.siteid = t2.siteid
  30. left join sa_agents t3 on t1.siteid = t3.siteid and t1.sys_enterpriseid = t3.sys_enterpriseid
  31. LEFT JOIN sys_dataextend t9 ON t1.sys_enterpriseid = t9.ownerid and ownertable='sys_enterprise' and t1.siteid = t9.siteid
  32. where t1.siteid = $siteid$
  33. and $where$