应用报表查询2.sql 491 B

1234567891011
  1. select t1.sys_reportid,
  2. t1.siteid,
  3. if(t1.reporttype = '积木报表', t2.type, 'datainfo') type,
  4. if(t1.reporttype = '积木报表', t2.name, t1.name) name
  5. from sys_report t1
  6. left join jimureport.jimu_report t2 on t1.jimu_report_id = t2.id
  7. where (ifnull(t1.siteid, '') = '' or t1.siteid = $siteid$)
  8. and t1.systemappid = $systemappid$
  9. and t1.isused = 1
  10. and ((t1.reporttype = '积木报表' and t2.id is not null)
  11. or (t1.reporttype != '积木报表'))