-- 删除中台服务云所有元数据  'hbp','hbss','hrcs','brm','bree'
if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_OBJECTTYPEREF WHERE FOBJECTTYPEID IN (SELECT FNUMBER FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM')) ;

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_OBJECTTYPEREF WHERE fentityid IN (SELECT fid FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_MAINENTITYINFO_L WHERE FID IN (SELECT FID FROM T_META_MAINENTITYINFO WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_MAINENTITYINFO WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM');

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_ENTITYINFO WHERE FID IN (SELECT FNUMBER FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_ENTITY WHERE FNUMBER IN (SELECT FNUMBER FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_FORM WHERE FNUMBER IN (SELECT FNUMBER FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_BIZUNITRELFORM WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM');

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_FORMDESIGN_L WHERE FID IN (SELECT FID FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM');

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_ENTITYDESIGN_L WHERE FID IN (SELECT FID FROM T_META_ENTITYDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_ENTITYDESIGN WHERE FBIZAPPID IN ('XYRL3+A8Z+Z','15NPDX/GJFOO','1IMTC4ANI0KA','1IMTM4VR8/21','WZDVYWA67UM');
