delete from sys_noun where NOUNITEM = 'TERM';
insert into sys_noun
select 'TERM', '202412', '默认上季度期次', nounsuper, nounlevel, nounorder, nounmodule, nounvalidity, readonly, nounprop, nounremarks, nounrelation, orgflag from sys_noun a where a.NOUNITEM = 'WORKDATE';


DELETE FROM SYS_NOUN WHERE NOUNITEM = 'CALC_STATE';

INSERT INTO sys_noun (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
VALUES ('CALC_STATE', 'CALC_STATE', '计算任务执行状态', 'BUSDICT', 2.000000000000000000000000000000, 0.000000000000000000000000000000, 'common', '0', '0', null, null, '1', '0');
INSERT INTO sys_noun (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
VALUES ('CALC_STATE', 'READY', '准备中', 'BUSDICT', 3.000000000000000000000000000000, 1.000000000000000000000000000000, 'common', '1', '0', null, null, '1', '0');
INSERT INTO sys_noun (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
VALUES ('CALC_STATE', 'RUNNING', '执行中', 'BUSDICT', 3.000000000000000000000000000000, 2.000000000000000000000000000000, 'common', '1', '0', null, null, '1', '0');
INSERT INTO sys_noun (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
VALUES ('CALC_STATE', 'END', '已完成', 'BUSDICT', 3.000000000000000000000000000000, 3.000000000000000000000000000000, 'common', '1', '0', null, null, '1', '0');
INSERT INTO sys_noun (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
VALUES ('CALC_STATE', 'ERROR', '异常', 'BUSDICT', 3.000000000000000000000000000000, 4.000000000000000000000000000000, 'common', '1', '0', null, null, '1', '0');


DELETE FROM sys_funinfo WHERE FUNCCODE IN ('BL100000','BL100001','BL100002','BL100003','BL100004','BL100006');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100000', '数据补录', '0', 1.000000000000000000000000000000, '0', 'null', 1.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100001', 'Excel补录模板配置', 'BL100000', 1.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/ExcelTmpQueryList', 2.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100002', '数据补录任务管理', 'BL100000', 2.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementTaskQueryList', 2.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100003', '数据补录及审核', 'BL100000', 3.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementTaskReviewList', 2.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100004', '数据补录任务进度查询', 'BL100000', 4.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementPlanQuery', 2.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('BL100006', '补录数据查询', 'BL100000', 6.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementResultQuery', 2.000000000000000000000000000000, null, '4tailbranch', 'null');

-- 删除原有的补录功能配置
delete from sys_funorginfo where FUNCCODE in ('M110000','M110001','M110002','M110003');
DELETE FROM sys_funorginfo WHERE FUNCCODE IN ('BL100000','BL100001','BL100002','BL100003','BL100004','BL100006');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100000', '355106');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100001', '355106');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100002', '355106');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100003', '355106');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100004', '355106');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '000000');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '351001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355001');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355101');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355102');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355103');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355104');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355105');
insert into sys_funorginfo (FUNCCODE, ORGCODE) values ('BL100006', '355106');

-- 删除原有的补录功能配置
delete from sys_roleright where FUNCCODE in ('M110000','M110001','M110002','M110003');
-- 增加新的数据补录功能配置
delete from sys_roleright where FUNCCODE in ('BL100000','BL100001','BL100002','BL100003','BL100004','BL100006');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100000', null, '0');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100001', null, '0');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100002', null, '0');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100003', null, '0');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100004', null, '0');
INSERT INTO sys_roleright (ROLEID, FUNCCODE, DATASCOPE, BLINE) VALUES ('sysadmin', 'BL100006', null, '0');

-- 监管报表菜单
delete from sys_funinfo where FUNCCODE in ('M150002','M150003');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('M150002', '第二档银行：G4B-2表外信用风险加权资产计算表（权重法）', 'M150000', 4.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementPlanQuery', 2.000000000000000000000000000000, null, '4tailbranch', 'null');
insert into sys_funinfo (FUNCCODE, FUNCNAME, PARENTCODE, ORDERNO, LEAF, URL, LEVELCODE, REMARK, ORGTYPE, TERMINALTYPE) values ('M150003', '第二档银行：G4B-2表外信用风险加权资产计算表（权重法）', 'M150000', 6.000000000000000000000000000000, '1', '/rdp/rdpAnalysis/analTemplate/query/SupplementResultQuery', 2.000000000000000000000000000000, null, '4tailbranch', 'null');


