--预置制造策略数据
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726636846679083008') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726636846679083008, 'ATO10', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:34:41'}, {ts'2019-09-30 13:40:30'}, 726636846679083008, '预测成品，产品在未收到订单之前不进行组装，仅安排零部件及长周期物料的产生与采购，组装过程按订单跟踪，产品入库后不隔离。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726638078965596160') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726638078965596160, 'ATO20', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:40:41'}, {ts'2019-09-30 13:41:41'}, 726638078965596160, '预测成品，产品客户化定制根据预测进行零部件的准备和长周期物料的生产与采购。收到订单后，按订单组装，产品加工过程，入库按跟踪号隔离。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726641642203004928') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726641642203004928, 'ATO30', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:42:41'}, {ts'2019-09-30 13:43:41'}, 726641642203004928, '预测成品，成品通用，根据预测进行零部件的准备和长周期物料的生产与采购。收到订单后，按订单组装。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726642594821720064') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726642594821720064, 'ETO10', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:44:41'}, {ts'2019-09-30 13:45:41'}, 726642594821720064, '项目型生产，计划，生产执行，采购过程按项目跟踪管理。库存管理中不区分项目库存。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726644108973850624') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726644108973850624, 'ETO20', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:46:41'}, {ts'2019-09-30 13:47:41'}, 726644108973850624, '项目型生产，在计划，生产，采购过程中按项目跟踪管理。库存也严格按照项目区分管理。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726647011977480192') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726647011977480192, 'MTO10', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:48:41'}, {ts'2019-09-30 13:49:41'}, 726647011977480192, '按销售订单生产，计划，生产执行，采购过程按照订单中的跟踪号进行跟踪管理。库存管理中不区分订单库存。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726647852524388352') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726647852524388352, 'MTO20', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:50:41'}, {ts'2019-09-30 13:51:41'}, 726647852524388352, '无产品预测，按销售订单生产，在计划的过程中，根据跟踪号跟踪计划，采购，生产，库存管理过程。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726648363868768256') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726648363868768256, 'MTS10', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:52:41'}, {ts'2019-09-30 13:53:41'}, 726648363868768256, '面向库存生产，由预测驱动生产，销售订单不影响生产。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726648866790981632') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726648866790981632, 'MTS11', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:54:41'}, {ts'2019-09-30 13:55:41'}, 726648866790981632, '面向库存生产，由预测驱动生产，销售订单不影响生产，MPS/MRP计算是不考虑库存。');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy WHERE FID = '726649316932075520') 
insert into t_bd_manufacturestrategy (FID, FNUMBER, FSTATUS, FCREATORID, FMODIFIERID, FENABLE, FCREATETIME, FMODIFYTIME, FMASTERID, FSTRATEGYDES)
values (726649316932075520, 'MTS20', 'C', 22132776, 22132776, '1', {ts'2019-09-30 13:56:41'}, {ts'2019-09-30 13:57:41'}, 726649316932075520, '面向库存生产，由预测和销售订单驱动生产。');

--预置制造策略数据-多语言
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0987Z8ZEWK7B') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0987Z8ZEWK7B', '726636846679083008', 'zh_CN', '预测成品，库存不隔离，预计量隔离');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0987Z8ZEWK7C') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0987Z8ZEWK7C', '726636846679083008', 'zh_TW', '預測成品，庫存不隔離，預計量隔離');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0988685GSVV6') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0988685GSVV6', '726638078965596160', 'zh_CN', '预测成品，产品定制');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0988685GSVV7') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0988685GSVV7', '726638078965596160', 'zh_TW', '預測成品，產品定製');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0988V6U9UXK1') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0988V6U9UXK1', '726641642203004928', 'zh_CN', '预测成品，产品通用');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0988V6U9UXK2') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0988V6U9UXK2', '726641642203004928', 'zh_TW', '預測成品，產品通用');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098904J1RF0W') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098904J1RF0W', '726642594821720064', 'zh_CN', '按项目制造，不区分库存');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098904J1RF0X') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098904J1RF0X', '726642594821720064', 'zh_TW', '按項目製造，不區分庫存');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0989A5V2=A9H') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0989A5V2=A9H', '726644108973850624', 'zh_CN', '按订单设计，库存隔离');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0989A5V2=A9I') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0989A5V2=A9I', '726644108973850624', 'zh_TW', '按訂單設計，庫存隔離');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0989VAW+Q2LS') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0989VAW+Q2LS', '726647011977480192', 'zh_CN', '按订单生产，不区分库存');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '0989VAW+Q2LT') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('0989VAW+Q2LT', '726647011977480192', 'zh_TW', '按訂單生產，不區分庫存');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=/FQQH2BV') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=/FQQH2BV', '726647852524388352', 'zh_CN', '按订单生产，库存隔离');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=/FQQH2BW') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=/FQQH2BW', '726647852524388352', 'zh_TW', '按訂單生產，庫存隔離');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=361DOZYC') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=361DOZYC', '726648363868768256', 'zh_CN', '净需求计划');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=361DOZYD') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=361DOZYD', '726648363868768256', 'zh_TW', '淨需求計劃');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=6V+BVE0+') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=6V+BVE0+', '726648866790981632', 'zh_CN', '毛需求计划');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098=6V+BVE0/') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098=6V+BVE0/', '726648866790981632', 'zh_TW', '毛需求計劃');

IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098==3XKXN9Z') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098==3XKXN9Z', '726649316932075520', 'zh_CN', '可冲销预测的净需求计划');
IF NOT EXISTS (SELECT 1 FROM t_bd_manufacturestrategy_l WHERE FPKID = '098==3XKXN=+') 
insert into t_bd_manufacturestrategy_l (FPKID, FID, FLOCALEID, FNAME)
values ('098==3XKXN=+', '726649316932075520', 'zh_TW', '可衝銷預測的淨需求計劃');


-- 带组织基础资料要加管控策略 全局共享   物料生产策略
--ren_chen  2019-09-29
IF NOT EXISTS (SELECT 1 FROM T_BD_DefaultCtrlStrategy WHERE FID = '725820033531680768') 
insert into T_BD_DefaultCtrlStrategy (FID, FNUMBER, FBASEDATAID, FCTRLVIEW, FDATATYPE, FDEFAULTMANAGESTRATEGY, FDEFAULTCTRLSTRATEGY, FISSYSTEM, FENABLE, FSTATUS, FCREATORID, FCREATETIME, FMODIFIERID, FMODIFYTIME, FDISABLERID, FDISABLEDATE, FAPPSYSTEMID, FMASTERID, FPLUGIN)
values ('725820033531680768', ' ', 'bd_materialmftinfo', 4, '2', '1', '5', '0', '1', 'A', 22132776, {ts'2019-09-29 10:34:02'}, 22132776, {ts'2019-09-29 10:34:50'}, 0, null, '15IWD0BF6M6/', '725820033531680768', ' ');
