-- 新增 研发人员分摊后薪资 数据源
DELETE FROM t_tctb_datasource WHERE FID = 1721626019997405184;
INSERT INTO t_tctb_datasource(FID,FBIZNAME,FISCHILD,FTYPE,FCONDITION,FORGTAKERELATION,FCREATEORGID,FSUBENTITYNAME,FUSERORG,FORGID,FMASTERID,FSTATUS,FCTRLSTRATEGY,FENTITYNAME,FGROUPID,FNUMBER,FCREATETIME,FMODIFIERID,FENABLE,FTAXTYPE,FMODIFYTIME,FCREATORID,FISSYSTEM) VALUES (1721626019997405184,'研发人员分摊后薪资','1','0',' ','0',100000,' ',100000,100000,1721626019997405184,'C','5','tdm_rd_apportion_pay',978216567512983552,' ',{ts'2023-07-04  00:00:00'},1626079457133782016,'1',' ',{ts'2023-07-04  00:00:00'},1626079457133782016,'1');


DELETE FROM t_tctb_datasource_l WHERE FPKID = '3DG4EBXY6K6Y';
INSERT INTO t_tctb_datasource_l(FID,FPKID,FLOCALEID,FNAME) VALUES (1721626019997405184,'3DG4EBXY6K6Y','zh_CN','tdm_rd_apportion_pay');


DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835584;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','编码','0','0',' ',1721626020416835584,'1','tdm_rd_apportion_pay','0','0','0',1,'number','0','编码','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835585;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','名称','0','0',' ',1721626020416835585,'1','tdm_rd_apportion_pay','0','0','0',2,'name','0','名称','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835586;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','数据状态','0','0',' ',1721626020416835586,'1','tdm_rd_apportion_pay','0','0','0',3,'status','0','数据状态','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835587;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','创建人','0','0',' ',1721626020416835587,'1','tdm_rd_apportion_pay','0','0','0',4,'creator','0','创建人','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835588;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','修改人','0','0',' ',1721626020416835588,'1','tdm_rd_apportion_pay','0','0','0',5,'modifier','0','修改人','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835589;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','使用状态','0','0',' ',1721626020416835589,'1','tdm_rd_apportion_pay','0','0','0',6,'enable','0','使用状态','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835590;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','创建时间','0','0',' ',1721626020416835590,'1','tdm_rd_apportion_pay','0','0','0',7,'createtime','0','创建时间','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835591;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','修改时间','0','0',' ',1721626020416835591,'1','tdm_rd_apportion_pay','0','0','0',8,'modifytime','0','修改时间','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835592;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','主数据内码','0','0',' ',1721626020416835592,'1','tdm_rd_apportion_pay','0','0','0',9,'masterid','0','主数据内码','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835593;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'1','税务组织','0','0',' ',1721626020416835593,'1','tdm_rd_apportion_pay','0','0','0',10,'taxorg','0','税务组织','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835594;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','开始日期','0','0',' ',1721626020416835594,'1','tdm_rd_apportion_pay','0','0','0',11,'startdate','0','开始日期','1');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835595;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','结束日期','0','0',' ',1721626020416835595,'1','tdm_rd_apportion_pay','0','0','0',12,'enddate','0','结束日期','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835596;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','项目编码','0','0',' ',1721626020416835596,'1','tdm_rd_apportion_pay','0','1','0',13,'project','0','项目编码','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835597;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','费用类型','0','0',' ',1721626020416835597,'1','tdm_rd_apportion_pay','0','1','0',14,'costtype','0','费用类型','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835598;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','数据来源','0','0',' ',1721626020416835598,'1','tdm_rd_apportion_pay','0','0','0',15,'datasource','0','数据来源','0');
DELETE FROM t_tctb_datasource_entry WHERE FENTRYID = 1721626020416835599;
INSERT INTO t_tctb_datasource_entry(FID,FORGSTATE,FBIZSUBNAME,FELEMENTWHERE,FYEARSTATE,FACCESSLOGIC,FENTRYID,FSTATE,FSUBNAME,FMONTHSTATE,FWHERESTATE,FISAMOUNT,FSEQ,FFIELDNAME,FINSPECTIONSHOWFIELD,FDESCRICE,FDATASTATE) VALUES (1721626019997405184,'0','金额','0','0',',bqhj,',1721626020416835599,'1','tdm_rd_apportion_pay','0','0','1',16,'amount','0','金额','0');


-- 全局删除一次关联数据源的中间表
DELETE FROM t_tctb_datasource_pkrules WHERE FBASEDATAID = 1422687369651333120;
DELETE FROM t_tctb_datasource_pkrules WHERE FBASEDATAID = 1581804953411099648;


-- 新增 研发人员分摊后薪资
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711681;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (1721626019997405184,1422687369651333120,1721626020416711681);
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711682;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (1721626019997405184,1581804953411099648,1721626020416711682);



-- 修改 折旧摊销税会差异台账 数据源
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711686;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (1079096155792531456,1422687369651333120,1721626020416711686); 
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711687;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (1079096155792531456,1581804953411099648,1721626020416711687);


--修改  凭证数据源
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711688;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (860044722440263680,1422687369651333120,1721626020416711688);
DELETE FROM t_tctb_datasource_pkrules WHERE FPKID = 1721626020416711689;
INSERT INTO t_tctb_datasource_pkrules(FID,FBASEDATAID,FPKID) VALUES (860044722440263680,1581804953411099648,1721626020416711689);