delete FROM t_brm_policy_l WHERE fid IN (select fid FROM t_brm_policy WHERE fnumber IN ('HOMSTR_CO0PE_UNDO_NOTICE','HOMSTR_CHECK_PASS_MESSAGE','HOMSTR_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSTR_COLLECT_NOTICE_MESSAGE','HOMSTR_APPOINTMEN_NOTICE_MESSAGE','HOMSTR_COLLECT_PASS_MESSAGE','HOMSTR_COLLECT_REJECT_MESSAGE','HOMSTR_COLLECT_TASK_NOTICE_MESSAG','HOMSTR_COLLECT_FAIL_MESSAGE','HOMSTR_ELIGIBLE_ACTIVITY','HOMSTR_VALIDITY_NOTICE_MESSAGE'));
delete FROM t_brm_policy_his_l  where fid in (select fid from t_brm_policy_his  where fpolicyid in (select fid FROM t_brm_policy WHERE fnumber IN ('HOMSTR_CO0PE_UNDO_NOTICE','HOMSTR_CHECK_PASS_MESSAGE','HOMSTR_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSTR_COLLECT_NOTICE_MESSAGE','HOMSTR_APPOINTMEN_NOTICE_MESSAGE','HOMSTR_COLLECT_PASS_MESSAGE','HOMSTR_COLLECT_REJECT_MESSAGE','HOMSTR_COLLECT_TASK_NOTICE_MESSAG','HOMSTR_COLLECT_FAIL_MESSAGE','HOMSTR_ELIGIBLE_ACTIVITY','HOMSTR_VALIDITY_NOTICE_MESSAGE')));
delete FROM t_brm_policy_his  where fpolicyid in (select fid FROM t_brm_policy WHERE fnumber IN ('HOMSTR_CO0PE_UNDO_NOTICE','HOMSTR_CHECK_PASS_MESSAGE','HOMSTR_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSTR_COLLECT_NOTICE_MESSAGE','HOMSTR_APPOINTMEN_NOTICE_MESSAGE','HOMSTR_COLLECT_PASS_MESSAGE','HOMSTR_COLLECT_REJECT_MESSAGE','HOMSTR_COLLECT_TASK_NOTICE_MESSAG','HOMSTR_COLLECT_FAIL_MESSAGE','HOMSTR_ELIGIBLE_ACTIVITY','HOMSTR_VALIDITY_NOTICE_MESSAGE'));
delete FROM t_brm_policy WHERE fnumber IN ('HOMSTR_CO0PE_UNDO_NOTICE','HOMSTR_CHECK_PASS_MESSAGE','HOMSTR_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSTR_COLLECT_NOTICE_MESSAGE','HOMSTR_APPOINTMEN_NOTICE_MESSAGE','HOMSTR_COLLECT_PASS_MESSAGE','HOMSTR_COLLECT_REJECT_MESSAGE','HOMSTR_COLLECT_TASK_NOTICE_MESSAG','HOMSTR_COLLECT_FAIL_MESSAGE','HOMSTR_ELIGIBLE_ACTIVITY','HOMSTR_VALIDITY_NOTICE_MESSAGE');

DELETE FROM T_BRM_SCENEINPUT_L WHERE fentryid in (select fentryid FROM T_BRM_SCENEINPUT WHERE fid in (select fid FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE')));
DELETE FROM T_BRM_SCENEOUTPUT_L WHERE fentryid in (select fentryid FROM T_BRM_SCENEOUTPUT WHERE fid in (select fid FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE')));
DELETE FROM T_BRM_SCENEINPUT WHERE fid in (select fid FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE'));
DELETE FROM T_BRM_SCENEOUTPUT WHERE fid in (select fid FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE'));
DELETE FROM T_BRM_SCENE_L WHERE fid in (select fid FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE'));
DELETE FROM T_BRM_SCENE WHERE fnumber in ('HOMSCE_CHECK_PASS_MESSAGE','HOMSCE_CHECK_FAIL_MESSAGE','HOMSCE_COOPE_MANAGE_NOTICE_TRANSFER','HOMSCE_COOPE_DO_NOTICE_TRANSFER','HOMSCE_CO0PE_UNDO_NOTICE','HOMSCE_COLLECT_NOTICE_MESSAGE','HOMSCE_APPOINTMEN_NOTICE_MESSAGE','HOMSCE_COLLECT_FAIL_MESSAGE','HOMSCE_COLLECT_PASS_MESSAGE','HOMSCE_COLLECT_REJECT_MESSAGE','HOMSCE_COLLECT_TASK_NOTICE_MESSAGE');
