--商品分类标准编码规则
IF NOT EXISTS ( SELECT 1 FROM T_CR_CODERULE WHERE  FID = '0CROG2QRD486' )
INSERT INTO T_CR_CODERULE (FID, FNUMBER, FRULETYPE, FBIZOBJECTID, FSPLITSIGN, FCTRLMODE, FAPPMODE, FEXAMPLE, FEXAMPLELENGTH, FENABLE, FSTATUS, FMASTERID, FISUPDATERECOVER,FCREATORID, FMODIFIERID, FDISABLERID, FCREATETIME, FMODIFYTIME, FDISABLEDATE) VALUES ('0CROG2QRD486', ' ', '', 'bd_goodsclassstandard', '-', '1', '3', ' ', ' ', '1', 'C',  '0CROG2QRD486', '0', '0', '1', '1', {ts'2019-11-21 12:59:59'}, {ts'2019-11-21 12:59:59'},null);

IF NOT EXISTS ( SELECT 1 FROM T_CR_CODERULE_L WHERE  FID = '0CROG2QRD486' AND FLOCALEID='zh_CN' )
INSERT INTO T_CR_CODERULE_L (FPKID, FID, FLOCALEID, FNAME) VALUES ('0CROG2QRD3JZ', '0CROG2QRD486', 'zh_CN', '商品分类标准编码规则');

IF NOT EXISTS ( SELECT 1 FROM T_CR_CODERULEENTRY WHERE  FID = '0CROG2QRD486' )
INSERT INTO T_CR_CODERULEENTRY (FENTRYID, FID, FSEQ, FATTRIBUTETYPE, FATTUSINGMODE, FVALUEATRIBUTE, FFORMAT, FSETTINGVALUE, FLENGTH, FINITIAL, FSTEP, FADDCHAR, FISSPLITSIGN, FADDSTYLE, FCUTSTYLE, FISSORTITEM, FSPLITSIGN, FISVISABLE) VALUES ('0CROG2T+E2VH', '0CROG2QRD486', '1', '16', '1', ' ', ' ', ' ', '8', '1', '1', ' ', '0', '1', '1', '0', '-', '1');

----商品品牌编码规则
IF NOT EXISTS ( SELECT 1 FROM T_CR_CODERULE WHERE  FID = '0HLETGRKYNMQ')
INSERT INTO T_CR_CodeRule(FID,FSPLITSIGN,FCTRLMODE,FEXAMPLE,FAPPMODE,FDISABLEDATE,FMASTERID,FSTATUS,FNUMBER,FRULETYPE,FEXAMPLELENGTH,FCREATETIME,FBIZOBJECTID,FENABLE,FMODIFIERID,FISUPDATERECOVER,FMODIFYTIME,FCREATORID,FDISABLERID) VALUES ('0HLETGRKYNMQ','-','1',' ','2',null,'0HLETGRKYNMQ','C',' ',null,' ',{ts'2020-01-13  17:48:53'},'mdr_item_brand','1',13466739,'0',{ts'2020-01-13  17:48:53'},13466739,null); 


IF NOT EXISTS ( SELECT 1 FROM T_CR_CodeRule_L  WHERE  FPKID = '0HLETGRKYOA/' AND FLOCALEID='zh_CN')
INSERT INTO T_CR_CodeRule_L(FID,FPKID,FLOCALEID,FNAME) VALUES ('0HLETGRKYNMQ','0HLETGRKYOA/','zh_CN','商品品牌');


IF NOT EXISTS ( SELECT 1 FROM T_CR_CODERULEENTRY WHERE  FENTRYID = '0HLETGTMPSW/' )
INSERT INTO T_CR_CODERULEENTRY(FID,FINITIAL,FATTRIBUTETYPE,FSPLITSIGN,FISSORTITEM,FENTRYID,FSTEP,FCUTSTYLE,FATTUSINGMODE,FSEQ,FLENGTH,FISVISABLE,FFORMAT,FSETTINGVALUE,FADDSTYLE,FVALUEATRIBUTE,FISSPLITSIGN,FADDCHAR) VALUES ('0HLETGRKYNMQ',1,'16',' ','0','0HLETGTMPSW/',1,'1','1',0,8,'1',' ',' ','1',' ','0',' '); 
