-- 删除核心人力所有元数据  'hrpi'（HR中台服务云） 'heo','hers','hlcs','hpbs','hom','htm','hspm','hpfs' （核心人力云）
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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU')) ;

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_MAINENTITYINFO WHERE FBIZAPPID IN ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU');

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_BIZUNITRELFORM WHERE FBIZAPPID IN ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU');

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_FORMDESIGN WHERE FBIZAPPID IN ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU');

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 ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU'));

if not exists(SELECT 1 FROM T_META_ENTITY WHERE FID = '2+QE4JA9QV27')
DELETE FROM T_META_ENTITYDESIGN WHERE FBIZAPPID IN ('1830FD9OF/PY','0MKMDD=Z19GD','1WXB5G9/BL46','1WXBPN7+OHJZ','198LGT61FE1D','1WTT6K3V3TD/','1XL6VIDTDRXN','0QO140ANVBBZ','/UHHATA9CLWU');
