营销大类列表查询.sql 568 B

123456789101112131415
  1. select itemclassid,itemclassname,0 isused from plm_itemclass t1 where siteid=$siteid$ and parentid=0 and classtype='营销' and not exists (
  2. SELECT
  3. t.v
  4. FROM
  5. sa_accountclass,
  6. JSON_TABLE(bindingcategories,"$[*]" COLUMNS ( v VARCHAR (128) PATH "$")) t where t.v=t1.itemclassid)
  7. UNION ALL
  8. select itemclassid,itemclassname,1 isused from plm_itemclass t1 where siteid=$siteid$ and parentid=0 and classtype='营销' and exists (
  9. SELECT
  10. t.v
  11. FROM
  12. sa_accountclass,
  13. JSON_TABLE(bindingcategories,"$[*]" COLUMNS ( v VARCHAR (128) PATH "$")) t where t.v=t1.itemclassid)