商品组商品明细查询.sql 696 B

12345678910111213141516171819
  1. SELECT t1.sa_itemgroupmxid,
  2. t1.sequence,
  3. t2.*,
  4. t6.unitname,
  5. t3.erpitemname,
  6. t3.erpitemno,
  7. t3.material,
  8. t4.schemename
  9. FROM sa_itemgroupmx t1
  10. inner JOIN plm_item t2 ON t1.itemid = t2.itemid and ifnull(t2.isonsale, 0) = 1
  11. AND t1.siteid = t2.siteid
  12. LEFT JOIN plm_unit t6 ON t6.unitid = t2.unitid
  13. AND t6.siteid = t2.siteid
  14. left join plm_itemextend t3 on t2.siteid = t3.siteid and t2.itemid = t3.itemid
  15. left join sa_customscheme t4 on t2.sa_customschemeid=t4.sa_customschemeid and t2.siteid=t4.siteid
  16. where $where$
  17. and t1.sa_itemgroupid = $sa_itemgroupid$
  18. and t1.siteid = $siteid$
  19. order by t1.sequence asc