所有账号查询.sql 871 B

123456789101112131415161718192021222324
  1. select t1.fusertype,
  2. t1.fphonenumber,
  3. t1.fname,
  4. t1.fisadministrator,
  5. t1.frole,
  6. t1.fsex,
  7. t1.fdatamodify,
  8. t2.fprovince,
  9. t2.fcity,
  10. t2.fcounty,
  11. t2.fagentname,
  12. t1.tenterprise_userid,
  13. t2.fsaleruserid,
  14. t3.fname as fsaler,
  15. t1.fcanreadagentanalysis,
  16. t2.ftype as fagenttype
  17. from tenterprise_users t1
  18. left join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
  19. left join tenterprise_users t3 on t2.siteid=t3.siteid and t2.fsaleruserid=t3.tenterprise_userid
  20. left join countryareaid t4 on t2.fprovince=t4.id
  21. left join countryareaid t5 on t2.fcity=t5.id
  22. left join countryareaid t6 on t2.fcounty=t6.id
  23. where (t1.fphonenumber is not null or t1.fname is not null)
  24. and t1.siteid =$siteid$ and $where$ and t1.fissysadministrator=0