DELETE FROM t_pur_calformulaentity WHERE FENTRYID = 1889100672847299584;
INSERT INTO t_pur_calformulaentity(FEVADIMENSIONFILTER,FID,FENTITYCODE,FCATEGORYFIELD,FENTRYID,FORDERBYFIELD,FORGFIELD,FGROUPBY,FSUPPLIERFIELD,FORDERBYTYPE,FMATERIALFIELD,FCHILDFORMULA,FINCLUDESUBORG,FAFTERFILTER,FEVALPERIODFIELD,FSEQ,FDEFAULTRESULT,FCHILDFORMULATRAN,FBEFOREFILTER,FAFTERFILTERTRAN,FMETADATAID,FBEFOREFILTERTRAN) VALUES ('A',1889100672671138816,'result1',' ',1889100672847299584,' ','org',' ','supplier',' ',' ','count( id ) ','0',' ','eventdate',1,-999999999.0000000000,'count( 单据头.内码(id) ) ','eventtype.number = ''A0501'' OR  eventtype.number = ''A0502''',' ','srm_eventlibrary','事件类型.编码 = ''A0501'' OR  事件类型.编码 = ''A0502'''); 
DELETE FROM t_pur_calformula WHERE FID = 1889100672671138816;
INSERT INTO t_pur_calformula(FID,FISPREINSDATA,FAUDITORID,FCONDITIONORDERBYFIELD,FPLUGINNAME,FMASTERID,FSTATUS,FCONDITIONBILLID,FNUMBER,FFORMULAPREVIEW,FAUDITDATE,FCREATETIME,FCONDITIONSUPPLIERFIELD,FMODIFIERID,FENABLE,FCALMETHOD,FREMARK,FCONDITIONORDERBYTYPE,FMODIFYTIME,FCREATORID,FFORMULA,FCONDITIONFIELD) VALUES (1889100672671138816,'1',1210710027598321664,' ',' ',1889100672671138816,'C',' ','eventlibrary_cal','if ( (count( 单据头.内码(id) ) ) = 0 ,5 , if ( ( 5-(count( 单据头.内码(id) ) ) ) < -5 , -5 , 5-(count( 单据头.内码(id) ) ) )  )',{ts'2024-02-20  00:00:00'},{ts'2024-02-20  00:00:00'},' ',1210710027598321664,'1','A',' ',' ',{ts'2024-02-20  00:00:00'},1210710027598321664,'if ( result1 = 0 ,5 , if ( ( 5-result1 ) < -5 , -5 , 5-result1 )  )',' '); 
DELETE FROM t_pur_calformula_l WHERE FID = 1889100672671138816 and FLOCALEID = 'zh_CN';
INSERT INTO t_pur_calformula_l(FID,FPKID,FLOCALEID,FNAME) VALUES (1889100672671138816,'3Y0HB=5XJA8J','zh_CN','事件库计算'); 
DELETE FROM t_pur_calformula_l WHERE FID = 1889100672671138816 and FLOCALEID = 'zh_TW';
INSERT INTO t_pur_calformula_l(FID,FPKID,FLOCALEID,FNAME) VALUES (1889100672671138816,'3Y0HB=5XJA8K','zh_TW','事件庫計算'); 
