IF NOT EXISTS (SELECT 1 FROM t_cr_coderule WHERE FID = '15Z7BHTNSZQ5')
INSERT INTO t_cr_coderule(FID,FDISABLERID,FSPLITSIGN,FCTRLMODE,FEXAMPLE,FAPPMODE,FDISABLEDATE,FMASTERID,FSTATUS,FNUMBER,FRULETYPE,FEXAMPLELENGTH,FCREATETIME,FBIZOBJECTID,FENABLE,FMODIFIERID,FISUPDATERECOVER,FMODIFYTIME,FCREATORID) 
VALUES ('15Z7BHTNSZQ5',NULL,'-','1',' ','2',NULL,'15Z7BHTNSZQ5','C','15Z77NB+U2UX',NULL,' ',{ts'2018-08-08  18:08:08'},'mds_setofflog','1',1,'0',{ts'2018-08-08  18:08:08'},1); 

IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '15Z7BHTNQVKW')
INSERT INTO t_cr_coderule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('15Z7BHTNSZQ5','15Z7BHTNQVKW','zh_CN','冲减日志'); 
IF NOT EXISTS (SELECT 1 FROM t_cr_coderule_l WHERE FPKID = '15Z7BHTNQVKV')
INSERT INTO t_cr_coderule_l(FID,FPKID,FLOCALEID,FNAME) VALUES ('15Z7BHTNSZQ5','15Z7BHTNQVKV','zh_TW','冲减日志'); 
 
IF NOT EXISTS (SELECT 1 FROM t_cr_coderuleentry WHERE FID = '15Z7BHTNSZQ5') 
INSERT INTO t_cr_coderuleentry (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) 
SELECT '15Z7BHUDT=99', '15Z7BHTNSZQ5', 0, '1', ' ', ' ', 'CJRZ', ' ', 8, 1, 1, ' ', '0', '1', '1', '0', ' ', '1' UNION
SELECT '15Z7BHUDT=9=', '15Z7BHTNSZQ5', 1, '9', '1', ' ', 'yyyyMMdd', ' ', 8, 1, 1, ' ', '1', '1', '1', '1', '-', '1' UNION
SELECT '15Z7BHUDT=9A', '15Z7BHTNSZQ5', 2, '16', '1', ' ', ' ', ' ', 6, 1, 1, ' ', '1', '1', '1', '0', '-', '1' ;

 