--预设成本要素多语言数据
IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DYZF2XYBLA/')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773126985240072192,'0DYZF2XYBLA/','zh_CN','系统预置','物料'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DYZF2XYBLA0')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773126985240072192,'0DYZF2XYBLA0','zh_TW','係統預置','物料'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ04D3XAN00')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773141433937984512,'0DZ04D3XAN00','zh_CN','系统预置','物料费用'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ04D3XAN01')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773141433937984512,'0DZ04D3XAN01','zh_TW','係統預置','物料費用'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ64L5RIQ0U')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773173574319126528,'0DZ64L5RIQ0U','zh_CN','系统预置','外协加工费'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ64L5RIQ0V')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773173574319126528,'0DZ64L5RIQ0V','zh_TW','係統預置','外協加工費'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ6V9F693XG')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773177371976173568,'0DZ6V9F693XG','zh_CN','系统预置','制造费用'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ6V9F693XH')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773177371976173568,'0DZ6V9F693XH','zh_TW','係統預置','製造費用'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ61SM9J7U6')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773173188837423104,'0DZ61SM9J7U6','zh_CN','系统预置','资源'); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_ELEMENT_L WHERE FPKID = '0DZ61SM9J7U7')
INSERT INTO T_CAD_ELEMENT_L(FID,FPKID,FLOCALEID,FREMARKS,FNAME) VALUES (773173188837423104,'0DZ61SM9J7U7','zh_TW','係統預置','資源'); 


IF NOT EXISTS (SELECT 1 FROM T_CAD_SUBELEMENT WHERE FID = 773175233367685120) 
INSERT INTO T_CAD_SUBELEMENT(FID,FTYPE,FCREATETIME,FMODIFIERID,FENABLE,FMODIFYTIME,FDEFAULTVALUE,FSTATUS,FCREATORID,FNUMBER,FISSYSTEM,FMASTERID) VALUES (773175233367685120,'001',{ts'2019-12-03  18:40:48'},1,'1',{ts'2019-12-03  18:41:10'},'1','C',1,'SE001','1',773175233367685120); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_SUBELEMENT WHERE FID = 773175492709890048) 
INSERT INTO T_CAD_SUBELEMENT(FID,FTYPE,FCREATETIME,FMODIFIERID,FENABLE,FMODIFYTIME,FDEFAULTVALUE,FSTATUS,FCREATORID,FNUMBER,FISSYSTEM,FMASTERID) VALUES (773175492709890048,'002',{ts'2019-12-03  18:41:14'},1,'1',{ts'2019-12-03  18:41:41'},'1','C',1,'SE002','1',773175492709890048); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_SUBELEMENT WHERE FID = 773177997665679360) 
INSERT INTO T_CAD_SUBELEMENT(FID,FTYPE,FCREATETIME,FMODIFIERID,FENABLE,FMODIFYTIME,FDEFAULTVALUE,FSTATUS,FCREATORID,FNUMBER,FISSYSTEM,FMASTERID) VALUES (773177997665679360,'003',{ts'2019-12-03  18:46:20'},1,'1',{ts'2019-12-03  18:46:39'},'1','C',1,'SE003','1',773177997665679360); 
DELETE FROM T_CAD_SUBELEMENT WHERE FID = 773176352911296512;

IF NOT EXISTS (SELECT 1 FROM T_CAD_SUBELEMENT WHERE FID = 773176352911296512) 
INSERT INTO T_CAD_SUBELEMENT(FID,FTYPE,FCREATETIME,FMODIFIERID,FENABLE,FMODIFYTIME,FDEFAULTVALUE,FSTATUS,FCREATORID,FNUMBER,FISSYSTEM,FMASTERID) VALUES (773176352911296512,'004',{ts'2019-12-03  18:43:11'},1,'1',{ts'2019-12-03  18:43:23'},'1','C',1,'SE004','1',773176352911296512); 

IF NOT EXISTS (SELECT 1 FROM T_CAD_SUBELEMENT WHERE FID = 773176488857077760) 
INSERT INTO T_CAD_SUBELEMENT(FID,FTYPE,FCREATETIME,FMODIFIERID,FENABLE,FMODIFYTIME,FDEFAULTVALUE,FSTATUS,FCREATORID,FNUMBER,FISSYSTEM,FMASTERID) VALUES (773176488857077760,'005',{ts'2019-12-03  18:43:28'},1,'1',{ts'2019-12-03  18:43:39'},'1','C',1,'SE005','1',773176488857077760); 

--修改默认成本类型币别
update t_cad_costtype set FCURRENCYID = 1 where FID = 773781994261075968;
