--商城商品分类标准(代供应商协同应用部提交脚本)#雷莉敏#2021-10-28
IF NOT EXISTS (SELECT 1 FROM t_bd_classstandard WHERE FID = 944841720602823680)
INSERT INTO t_bd_classstandard(fid,fcreateorgid,fdisabledate,forgid,fmasterid,fstatus,fctrlstrategy,fnumber,fcreatetime,fmodifierid,fenable,fispreset,fmodifytime,fcreatorid,fdisablerid,fscope) VALUES (944841720602823680,100000,NULL,0,944841720602823680,'C','5','00000801',{ts'2021-05-20  00:00:00'},1,'1','1',{ts'2021-05-20  00:00:00'},1,0,',1,'); 

-- 如果已经通过商品分类列表界面的预置商品标准分类按钮预置了商品分类标准，则把预置sql插入的数据删掉
IF EXISTS (SELECT 1 FROM t_bd_classstandard_l WHERE fid = 944841720602823680 AND flocaleid = 'zh_CN' AND fpkid <> '1MG5J6RN/ETT')
DELETE FROM t_bd_classstandard_l WHERE fid = 944841720602823680 and flocaleid = 'zh_CN' AND fpkid = '1MG5J6RN/ETT';

IF NOT EXISTS (SELECT 1 FROM t_bd_classstandard_l WHERE fid = 944841720602823680 AND flocaleid = 'zh_CN')
INSERT INTO t_bd_classstandard_l(fid,fpkid,flocaleid,fdescription,fname) VALUES (944841720602823680,'1MG5J6RN/ETT','zh_CN',' ','商城商品分类标准'); 

--升级历史数据中的商品分类标准的字段应用范围的值为销售和采购#雷莉敏#2021-10-28
UPDATE T_BD_CLASSSTANDARD SET FSCOPE=',0,1,' WHERE FSCOPE = ' ';