-- 余额模型 scm库
-- 生产退料单余额模型
delete from t_plat_dymaccds where fid='920992273083197440';
insert into t_plat_dymaccds (FID, FCREATORID, FMODIFIERID, FCREATETIME, FMODIFYTIME, FSRCBILL, FRUNCONDITIONDESC, FRUNCONDITION, FISINIT, FENABLE, FUPDATETYPE, FDYMACC)
values ('920992273083197440', '1', '1', {ts'2020-06-24 17:50:00'}, {ts'2020-06-24 17:50:00'}, 'im_mdc_mftreturnorder', '是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftreturnorder_BT_S_R', '{"expression":"","exprTran":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftreturnorder_BT_S_R","description":{"zh_CN":""},"filterCondition":{"filterRow":[{"id":"0W3DF8P0BO89","leftBracket":"","compareType":"105","fieldName":"isvirtualbill","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ8","value":"0"}]},{"id":"0W3DF8P0BO8=","leftBracket":"","compareType":"105","fieldName":"invscheme.isoutupdate","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ9","value":"1"}]},{"id":"0WUZCFYPIQJR","leftBracket":"","compareType":"67","fieldName":"billtype.number","rightBracket":"","logic":"0","value":[{"id":"0WUZCFYPKL9F","value":"im_mdc_mftreturnorder_BT_S_R"}]}]},"localeExprTran":{"zh_CN":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftreturnorder_BT_S_R"},"exprDesc":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftreturnorder_BT_S_R"}', '0', '1', 'SUB', '544603717274490880');

-- 生产领料单余额模型
delete from t_plat_dymaccds where fid='921001378606798848';
insert into t_plat_dymaccds (FID, FCREATORID, FMODIFIERID, FCREATETIME, FMODIFYTIME, FSRCBILL, FRUNCONDITIONDESC, FRUNCONDITION, FISINIT, FENABLE, FUPDATETYPE, FDYMACC)
values ('921001378606798848', '1', '1', {ts'2020-06-24 17:50:00'},{ts'2020-06-24 17:50:00'}, 'im_mdc_mftproorder', '是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftproorder_BT_S', '{"expression":"","exprTran":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftproorder_BT_S","description":{"zh_CN":""},"filterCondition":{"filterRow":[{"id":"0W3DF8P0BO89","leftBracket":"","compareType":"105","fieldName":"isvirtualbill","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ8","value":"0"}]},{"id":"0W3DF8P0BO8=","leftBracket":"","compareType":"105","fieldName":"invscheme.isoutupdate","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ9","value":"1"}]},{"id":"0WPM32DRSEC8","leftBracket":"","compareType":"67","fieldName":"billtype.number","rightBracket":"","logic":"0","value":[{"id":"0WPM32DRRZVK","value":"im_mdc_mftproorder_BT_S"}]}]},"exprDesc":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftproorder_BT_S","localeExprTran":{"zh_CN":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftproorder_BT_S"}}', '0', '1', 'SUB', '544603717274490880');

-- 生产补料单余额模型
delete from t_plat_dymaccds where fid='921791102246355968';
insert into t_plat_dymaccds (FID, FCREATORID, FMODIFIERID, FCREATETIME, FMODIFYTIME, FSRCBILL, FRUNCONDITIONDESC, FRUNCONDITION, FISINIT, FENABLE, FUPDATETYPE, FDYMACC)
values ('921791102246355968', '1', '1', {ts'2020-06-24 17:50:00'}, {ts'2020-06-24 17:50:00'}, 'im_mdc_mftfeedorder', '是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftfeedorder_BT_R', '{"expression":"","exprTran":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftfeedorder_BT_R","description":{"zh_CN":""},"filterCondition":{"filterRow":[{"id":"0W3DF8P0BO89","leftBracket":"","compareType":"105","fieldName":"isvirtualbill","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ8","value":"0"}]},{"id":"0W3DF8P0BO8=","leftBracket":"","compareType":"105","fieldName":"invscheme.isoutupdate","rightBracket":"","logic":"0","value":[{"id":"0W3DF8P0BLJ9","value":"1"}]},{"id":"0WPM0+YQFKFE","leftBracket":"","compareType":"67","fieldName":"billtype.number","rightBracket":"","logic":"0","value":[{"id":"0WPM0+YQF3YR","value":"im_mdc_mftfeedorder_BT_R"}]}]},"exprDesc":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftfeedorder_BT_R","localeExprTran":{"zh_CN":"是否虚单 等于 否   and    库存事务.出库更新 等于 是   and    单据类型.编码 等于 im_mdc_mftfeedorder_BT_R"}}', '0', '1', 'SUB', '544603717274490880');


delete from t_plat_dymaccdsmappentry WHERE FID = '921791102246355968'; 

delete from t_plat_dymaccdsmappentry WHERE FID = '921001378606798848';
delete from t_plat_dymaccdsmappentry WHERE FID = '920992273083197440';

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802944') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802944', '921001378606798848', '1', '库存组织', 'org', '0', ' ', ' ', 'org', '单据头.库存组织');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802945') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802945', '921001378606798848', '2', '物料', 'material', '0', ' ', ' ', 'billentry.material.masterid', '物料明细.物料编码.物料');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802946') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802946', '921001378606798848', '3', '货主类型', 'ownertype', '0', ' ', ' ', 'billentry.outownertype', '物料明细.出库货主类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802947') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802947', '921001378606798848', '4', '货主', 'owner', '0', ' ', ' ', 'billentry.outowner', '物料明细.出库货主');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802948') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802948', '921001378606798848', '5', '仓库', 'warehouse', '0', ' ', ' ', 'billentry.warehouse', '物料明细.仓库');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802949') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802949', '921001378606798848', '6', '仓位', 'location', '0', ' ', ' ', 'billentry.location', '物料明细.仓位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802950') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802950', '921001378606798848', '7', '保管者类型', 'keepertype', '0', ' ', ' ', 'billentry.outkeepertype', '物料明细.出库保管者类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802951') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802951', '921001378606798848', '8', '辅助属性', 'auxpty', '0', ' ', ' ', 'billentry.auxpty', '物料明细.辅助属性');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802952') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802952', '921001378606798848', '9', '保管者', 'keeper', '0', ' ', ' ', 'billentry.outkeeper', '物料明细.出库保管者');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802953') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802953', '921001378606798848', '10', '库存状态', 'invstatus', '0', ' ', ' ', 'billentry.outinvstatus', '物料明细.出库库存状态');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802954') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802954', '921001378606798848', '11', '批号id', 'lot', '0', ' ', ' ', 'billentry.lot', '物料明细.批号ID');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802955') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802955', '921001378606798848', '12', '发生日期', 'updatetime', '0', ' ', ' ', 'biztime', '单据头.业务日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802956') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802956', '921001378606798848', '13', '基本单位', 'baseunit', '0', ' ', ' ', 'billentry.baseunit', '物料明细.基本单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802957') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802957', '921001378606798848', '14', '库存单位', 'unit', '0', ' ', ' ', 'billentry.unit', '物料明细.计量单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802958') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802958', '921001378606798848', '15', '辅助单位', 'unit2nd', '0', ' ', ' ', 'billentry.unit2nd', '物料明细.辅助单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802959') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802959', '921001378606798848', '16', '次辅单位', 'unit3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802960') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802960', '921001378606798848', '17', '生产日期', 'producedate', '0', ' ', ' ', 'billentry.producedate', '物料明细.生产日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802961') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802961', '921001378606798848', '18', '有效期至', 'expirydate', '0', ' ', ' ', 'billentry.expirydate', '物料明细.到期日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802962') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802962', '921001378606798848', '19', '物料名称', 'materialname', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802963') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802963', '921001378606798848', '20', '库存类型', 'invtype', '0', ' ', ' ', 'billentry.outinvtype', '物料明细.出库库存类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802964') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802964', '921001378606798848', '21', '项目', 'project', '0', ' ', ' ', 'billentry.project', '物料明细.项目');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802965') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802965', '921001378606798848', '22', '库存量(基本单位)', 'baseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802966') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802966', '921001378606798848', '23', '库存量(库存单位)', 'qty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802967') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802967', '921001378606798848', '24', '库存量(辅助单位)', 'qty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802968') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802968', '921001378606798848', '25', '库存量(次辅单位)', 'qty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802969') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802969', '921001378606798848', '26', '锁库量(基本单位)', 'lockbaseqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802970') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802970', '921001378606798848', '27', '锁库量(库存单位)', 'lockqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802971') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802971', '921001378606798848', '28', '锁库量(辅助单位)', 'lockqty2nd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802972') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802972', '921001378606798848', '29', '锁库量(次辅单位)', 'lockqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802973') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802973', '921001378606798848', '30', '可用量(基本单位)', 'avbbaseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802974') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802974', '921001378606798848', '31', '可用量(库存单位)', 'avbqty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802975') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802975', '921001378606798848', '32', '可用量(辅助单位)', 'avbqty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802976') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802976', '921001378606798848', '33', '可用量(次辅单位)', 'avbqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921001378606802977') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921001378606802977', '921001378606798848', '34', '批号', 'lotnum', '0', ' ', ' ', 'billentry.lotnumber', '物料明细.批号');



IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193344')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193344', '920992273083197440', '1', '库存组织', 'org', '0', ' ', ' ', 'org', '单据头.库存组织');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193345')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193345', '920992273083197440', '2', '物料', 'material', '0', ' ', ' ', 'billentry.material.masterid', '物料明细.物料编码.物料');


IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193346') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193346', '920992273083197440', '3', '货主类型', 'ownertype', '0', ' ', ' ', 'billentry.outownertype', '物料明细.出库货主类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193347') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193347', '920992273083197440', '4', '货主', 'owner', '0', ' ', ' ', 'billentry.outowner', '物料明细.出库货主');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193348')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193348', '920992273083197440', '5', '仓库', 'warehouse', '0', ' ', ' ', 'billentry.warehouse', '物料明细.仓库');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193349')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193349', '920992273083197440', '6', '仓位', 'location', '0', ' ', ' ', 'billentry.location', '物料明细.仓位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193350') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193350', '920992273083197440', '7', '保管者类型', 'keepertype', '0', ' ', ' ', 'billentry.outkeepertype', '物料明细.出库保管者类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193351')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193351', '920992273083197440', '8', '辅助属性', 'auxpty', '0', ' ', ' ', 'billentry.auxpty', '物料明细.辅助属性');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193352') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193352', '920992273083197440', '9', '保管者', 'keeper', '0', ' ', ' ', 'billentry.outkeeper', '物料明细.出库保管者');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193353') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193353', '920992273083197440', '10', '库存状态', 'invstatus', '0', ' ', ' ', 'billentry.outinvstatus', '物料明细.出库库存状态');


IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193354')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193354', '920992273083197440', '11', '批号id', 'lot', '0', ' ', ' ', 'billentry.lot', '物料明细.批号ID');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193355')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193355', '920992273083197440', '12', '发生日期', 'updatetime', '0', ' ', ' ', 'biztime', '单据头.业务日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193356')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193356', '920992273083197440', '13', '基本单位', 'baseunit', '0', ' ', ' ', 'billentry.baseunit', '物料明细.基本单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193357')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193357', '920992273083197440', '14', '库存单位', 'unit', '0', ' ', ' ', 'billentry.unit', '物料明细.计量单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193358')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193358', '920992273083197440', '15', '辅助单位', 'unit2nd', '0', ' ', ' ', 'billentry.unit2nd', '物料明细.辅助单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193359')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193359', '920992273083197440', '16', '次辅单位', 'unit3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193360')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193360', '920992273083197440', '17', '生产日期', 'producedate', '0', ' ', ' ', 'billentry.producedate', '物料明细.生产日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193361')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193361', '920992273083197440', '18', '有效期至', 'expirydate', '0', ' ', ' ', 'billentry.expirydate', '物料明细.到期日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193362')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193362', '920992273083197440', '19', '物料名称', 'materialname', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193363')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193363', '920992273083197440', '20', '库存类型', 'invtype', '0', ' ', ' ', 'billentry.outinvtype', '物料明细.出库库存类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193364')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193364', '920992273083197440', '21', '项目', 'project', '0', ' ', ' ', 'billentry.project', '物料明细.项目');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193365')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193365', '920992273083197440', '22', '库存量(基本单位)', 'baseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193366')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193366', '920992273083197440', '23', '库存量(库存单位)', 'qty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193367')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193367', '920992273083197440', '24', '库存量(辅助单位)', 'qty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193368')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193368', '920992273083197440', '25', '库存量(次辅单位)', 'qty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193369')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193369', '920992273083197440', '26', '锁库量(基本单位)', 'lockbaseqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193370')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193370', '920992273083197440', '27', '锁库量(库存单位)', 'lockqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193371')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193371', '920992273083197440', '28', '锁库量(辅助单位)', 'lockqty2nd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193372')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193372', '920992273083197440', '29', '锁库量(次辅单位)', 'lockqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193373')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193373', '920992273083197440', '30', '可用量(基本单位)', 'avbbaseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193374')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193374', '920992273083197440', '31', '可用量(库存单位)', 'avbqty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193375')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193375', '920992273083197440', '32', '可用量(辅助单位)', 'avbqty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193376')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193376', '920992273083197440', '33', '可用量(次辅单位)', 'avbqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '920992273083193377')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('920992273083193377', '920992273083197440', '34', '批号', 'lotnum', '0', ' ', ' ', 'billentry.lotnumber', '物料明细.批号');


IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251520') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251520', '921791102246355968', '1', '库存组织', 'org', '0', ' ', ' ', 'org', '单据头.库存组织');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251521') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251521', '921791102246355968', '2', '物料', 'material', '0', ' ', ' ', 'billentry.material.masterid', '物料明细.物料编码.物料');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251522') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251522', '921791102246355968', '3', '货主类型', 'ownertype', '0', ' ', ' ', 'billentry.outownertype', '物料明细.出库货主类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251523') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251523', '921791102246355968', '4', '货主', 'owner', '0', ' ', ' ', 'billentry.outowner', '物料明细.出库货主');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251524') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251524', '921791102246355968', '5', '仓库', 'warehouse', '0', ' ', ' ', 'billentry.warehouse', '物料明细.仓库');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251525') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251525', '921791102246355968', '6', '仓位', 'location', '0', ' ', ' ', 'billentry.location', '物料明细.仓位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251526') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251526', '921791102246355968', '7', '保管者类型', 'keepertype', '0', ' ', ' ', 'billentry.outkeepertype', '物料明细.出库保管者类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251527') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251527', '921791102246355968', '8', '辅助属性', 'auxpty', '0', ' ', ' ', 'billentry.auxpty', '物料明细.辅助属性');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251528') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251528', '921791102246355968', '9', '保管者', 'keeper', '0', ' ', ' ', 'billentry.outkeeper', '物料明细.出库保管者');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251529') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251529', '921791102246355968', '10', '库存状态', 'invstatus', '0', ' ', ' ', 'billentry.outinvstatus', '物料明细.出库库存状态');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251530') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251530', '921791102246355968', '11', '批号id', 'lot', '0', ' ', ' ', 'billentry.lot', '物料明细.批号ID');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251531') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251531', '921791102246355968', '12', '发生日期', 'updatetime', '0', ' ', ' ', 'biztime', '单据头.业务日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251532') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251532', '921791102246355968', '13', '基本单位', 'baseunit', '0', ' ', ' ', 'billentry.baseunit', '物料明细.基本单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251533') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251533', '921791102246355968', '14', '库存单位', 'unit', '0', ' ', ' ', 'billentry.unit', '物料明细.计量单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251534') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251534', '921791102246355968', '15', '辅助单位', 'unit2nd', '0', ' ', ' ', 'billentry.unit2nd', '物料明细.辅助单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251535') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251535', '921791102246355968', '16', '次辅单位', 'unit3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251536') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251536', '921791102246355968', '17', '生产日期', 'producedate', '0', ' ', ' ', 'billentry.producedate', '物料明细.生产日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251537') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251537', '921791102246355968', '18', '有效期至', 'expirydate', '0', ' ', ' ', 'billentry.expirydate', '物料明细.到期日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251538') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251538', '921791102246355968', '19', '物料名称', 'materialname', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251539') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251539', '921791102246355968', '20', '库存类型', 'invtype', '0', ' ', ' ', 'billentry.outinvtype', '物料明细.出库库存类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251540') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251540', '921791102246355968', '21', '项目', 'project', '0', ' ', ' ', 'billentry.project', '物料明细.项目');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251541') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251541', '921791102246355968', '22', '库存量(基本单位)', 'baseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251542') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251542', '921791102246355968', '23', '库存量(库存单位)', 'qty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251543') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251543', '921791102246355968', '24', '库存量(辅助单位)', 'qty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251544') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251544', '921791102246355968', '25', '库存量(次辅单位)', 'qty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251545') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251545', '921791102246355968', '26', '锁库量(基本单位)', 'lockbaseqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251546') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251546', '921791102246355968', '27', '锁库量(库存单位)', 'lockqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251547') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251547', '921791102246355968', '28', '锁库量(辅助单位)', 'lockqty2nd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251548') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251548', '921791102246355968', '29', '锁库量(次辅单位)', 'lockqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251549') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251549', '921791102246355968', '30', '可用量(基本单位)', 'avbbaseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251550') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251550', '921791102246355968', '31', '可用量(库存单位)', 'avbqty', '0', ' ', ' ', 'billentry.qty', '物料明细.数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251551') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251551', '921791102246355968', '32', '可用量(辅助单位)', 'avbqty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251552') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251552', '921791102246355968', '33', '可用量(次辅单位)', 'avbqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921791102246251553') 
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921791102246251553', '921791102246355968', '34', '批号', 'lotnum', '0', ' ', ' ', 'billentry.lotnumber', '物料明细.批号');


-- 完工入库单余额模型 
DELETE FROM t_plat_dymaccds WHERE FID = 921786121778784256;
insert into t_plat_dymaccds (FID, FCREATORID, FMODIFIERID, FCREATETIME, FMODIFYTIME, FSRCBILL, FRUNCONDITIONDESC, FRUNCONDITION, FISINIT, FENABLE, FUPDATETYPE, FDYMACC)
values (921786121778784256, 1, 1, {ts'2020-06-24 17:37:00'}, {ts'2020-06-24 17:37:00'}, 'im_mdc_mftmanuinbill', '单据类型.编码 等于 im_mdc_mftmanuinbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是', '{"expression":"","exprTran":"单据类型.编码 等于 im_mdc_mftmanuinbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是","description":{"zh_CN":""},"filterCondition":{"filterRow":[{"id":"0WPLWEHR1TNL","leftBracket":"","compareType":"67","fieldName":"billtype.number","rightBracket":"","logic":"0","value":[{"id":"0WPLWEHR1C4Y","value":"im_mdc_mftmanuinbill_BT_S"}]},{"id":"0WUJM=Q5TT+3","leftBracket":"","compareType":"105","fieldName":"isvirtualbill","rightBracket":"","logic":"0","value":[{"id":"0WUJM=Q9FC7Y","value":"0"}]},{"id":"0WUJM=Q9F75M","leftBracket":"","compareType":"105","fieldName":"invscheme.isinupdate","rightBracket":"","logic":"0","value":[{"id":"0WUJM=Q9FC7Z","value":"1"}]}]},"localeExprTran":{"zh_CN":"单据类型.编码 等于 im_mdc_mftmanuinbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是"},"exprDesc":"单据类型.编码 等于 im_mdc_mftmanuinbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是"}', '0', '1', 'ADD', '544603717274490880');

delete from t_plat_dymaccdsmappentry WHERE FID = '921786121778784256';

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783232')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783232', '921786121778784256', '1', '库存组织', 'org', '0', ' ', ' ', 'org', '单据头.入库组织');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783233')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783233', '921786121778784256', '2', '物料', 'material', '0', ' ', ' ', 'billentry.material.masterid', '物料明细.物料编码.物料');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783234')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783234', '921786121778784256', '3', '货主类型', 'ownertype', '0', ' ', ' ', 'billentry.ownertype', '物料明细.入库货主类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783235')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783235', '921786121778784256', '4', '货主', 'owner', '0', ' ', ' ', 'billentry.owner', '物料明细.入库货主');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783236')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783236', '921786121778784256', '5', '仓库', 'warehouse', '0', ' ', ' ', 'billentry.warehouse', '物料明细.仓库');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783237')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783237', '921786121778784256', '6', '仓位', 'location', '0', ' ', ' ', 'billentry.location', '物料明细.仓位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783238')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783238', '921786121778784256', '7', '保管者类型', 'keepertype', '0', ' ', ' ', 'billentry.keepertype', '物料明细.入库保管者类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783239')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783239', '921786121778784256', '8', '辅助属性', 'auxpty', '0', ' ', ' ', 'billentry.auxpty', '物料明细.辅助属性');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783240')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783240', '921786121778784256', '9', '保管者', 'keeper', '0', ' ', ' ', 'billentry.keeper', '物料明细.入库保管者');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783241')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783241', '921786121778784256', '10', '库存状态', 'invstatus', '0', ' ', ' ', 'billentry.invstatus', '物料明细.入库库存状态');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783242')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783242', '921786121778784256', '11', '批号id', 'lot', '0', ' ', ' ', 'billentry.lot', '物料明细.批号ID');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783243')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783243', '921786121778784256', '12', '发生日期', 'updatetime', '0', ' ', ' ', 'biztime', '单据头.业务日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783244')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783244', '921786121778784256', '13', '基本单位', 'baseunit', '0', ' ', ' ', 'billentry.baseunit', '物料明细.基本单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783245')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783245', '921786121778784256', '14', '库存单位', 'unit', '0', ' ', ' ', 'billentry.unit', '物料明细.计量单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783246')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783246', '921786121778784256', '15', '辅助单位', 'unit2nd', '0', ' ', ' ', 'billentry.unit2nd', '物料明细.辅助单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783247')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783247', '921786121778784256', '16', '次辅单位', 'unit3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783248')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783248', '921786121778784256', '17', '生产日期', 'producedate', '0', ' ', ' ', 'billentry.producedate', '物料明细.生产日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783249')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783249', '921786121778784256', '18', '有效期至', 'expirydate', '0', ' ', ' ', 'billentry.expirydate', '物料明细.到期日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783250')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783250', '921786121778784256', '19', '物料名称', 'materialname', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783251')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783251', '921786121778784256', '20', '库存类型', 'invtype', '0', ' ', ' ', 'billentry.invtype', '物料明细.入库库存类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783252')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783252', '921786121778784256', '21', '项目', 'project', '0', ' ', ' ', 'billentry.project', '物料明细.项目');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783253')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783253', '921786121778784256', '22', '库存量(基本单位)', 'baseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783254')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783254', '921786121778784256', '23', '库存量(库存单位)', 'qty', '0', ' ', ' ', 'billentry.qty', '物料明细.入库数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783255')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783255', '921786121778784256', '24', '库存量(辅助单位)', 'qty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783256')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783256', '921786121778784256', '25', '库存量(次辅单位)', 'qty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783257')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783257', '921786121778784256', '26', '锁库量(基本单位)', 'lockbaseqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783258')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783258', '921786121778784256', '27', '锁库量(库存单位)', 'lockqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783259')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783259', '921786121778784256', '28', '锁库量(辅助单位)', 'lockqty2nd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783260')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783260', '921786121778784256', '29', '锁库量(次辅单位)', 'lockqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783261')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783261', '921786121778784256', '30', '可用量(基本单位)', 'avbbaseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783262')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783262', '921786121778784256', '31', '可用量(库存单位)', 'avbqty', '0', ' ', ' ', 'billentry.qty', '物料明细.入库数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783263')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783263', '921786121778784256', '32', '可用量(辅助单位)', 'avbqty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783264')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783264', '921786121778784256', '33', '可用量(次辅单位)', 'avbqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921786121778783265')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921786121778783265', '921786121778784256', '34', '批号', 'lotnum', '0', ' ', ' ', 'billentry.lotnumber', '物料明细.批号');

--完工退库单余额模型
DELETE FROM t_plat_dymaccds WHERE FID = 921859854170220544;
insert into t_plat_dymaccds (FID, FCREATORID, FMODIFIERID, FCREATETIME, FMODIFYTIME, FSRCBILL, FRUNCONDITIONDESC, FRUNCONDITION, FISINIT, FENABLE, FUPDATETYPE, FDYMACC)
values (921859854170220544, 1, 1, {ts'2020-06-24 17:37:00'}, {ts'2020-06-24 17:37:00'}, 'im_mdc_mftreturnbill', '单据类型.编码 等于 im_mdc_mftreturnbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是', '{"expression":"","exprTran":"单据类型.编码 等于 im_mdc_mftreturnbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是","description":{"zh_CN":""},"filterCondition":{"filterRow":[{"id":"0WUJGH=3J8SW","leftBracket":"","compareType":"67","fieldName":"billtype.number","rightBracket":"","logic":"0","value":[{"id":"0WUJGH=3JDV6","value":"im_mdc_mftreturnbill_BT_S"}]},{"id":"0WUJGH=3J8SX","leftBracket":"","compareType":"105","fieldName":"isvirtualbill","rightBracket":"","logic":"0","value":[{"id":"0WUJGH=3JDV7","value":"0"}]},{"id":"0WUJGH=3J8SY","leftBracket":"","compareType":"105","fieldName":"invscheme.isinupdate","rightBracket":"","logic":"0","value":[{"id":"0WUJGH=3JDV8","value":"1"}]}]},"localeExprTran":{"zh_CN":"单据类型.编码 等于 im_mdc_mftreturnbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是"},"exprDesc":"单据类型.编码 等于 im_mdc_mftreturnbill_BT_S   and    是否虚单 等于 否   and    库存事务.入库更新 等于 是"}', '0', '1', 'ADD', '544603717274490880');


delete from t_plat_dymaccdsmappentry WHERE FID = '921859854170220544';

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608128')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608128', '921859854170220544', '1', '库存组织', 'org', '0', ' ', ' ', 'org', '单据头.退库组织');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608129')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608129', '921859854170220544', '2', '物料', 'material', '0', ' ', ' ', 'billentry.material.masterid', '物料明细.物料编码.物料');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608130')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608130', '921859854170220544', '3', '货主类型', 'ownertype', '0', ' ', ' ', 'billentry.ownertype', '物料明细.退库货主类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608131')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608131', '921859854170220544', '4', '货主', 'owner', '0', ' ', ' ', 'billentry.owner', '物料明细.退库货主');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608132')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608132', '921859854170220544', '5', '仓库', 'warehouse', '0', ' ', ' ', 'billentry.warehouse', '物料明细.仓库');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608133')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608133', '921859854170220544', '6', '仓位', 'location', '0', ' ', ' ', 'billentry.location', '物料明细.仓位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608134')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608134', '921859854170220544', '7', '保管者类型', 'keepertype', '0', ' ', ' ', 'billentry.keepertype', '物料明细.退库保管者类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608135')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608135', '921859854170220544', '8', '辅助属性', 'auxpty', '0', ' ', ' ', 'billentry.auxpty', '物料明细.辅助属性');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608136')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608136', '921859854170220544', '9', '保管者', 'keeper', '0', ' ', ' ', 'billentry.keeper', '物料明细.退库保管者');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608137')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608137', '921859854170220544', '10', '库存状态', 'invstatus', '0', ' ', ' ', 'billentry.invstatus', '物料明细.退库库存状态');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608138')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608138', '921859854170220544', '11', '批号id', 'lot', '0', ' ', ' ', 'billentry.lot', '物料明细.批号ID');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608139')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608139', '921859854170220544', '12', '发生日期', 'updatetime', '0', ' ', ' ', 'biztime', '单据头.业务日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608140')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608140', '921859854170220544', '13', '基本单位', 'baseunit', '0', ' ', ' ', 'billentry.baseunit', '物料明细.基本单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608141')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608141', '921859854170220544', '14', '库存单位', 'unit', '0', ' ', ' ', 'billentry.unit', '物料明细.计量单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608142')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608142', '921859854170220544', '15', '辅助单位', 'unit2nd', '0', ' ', ' ', 'billentry.unit2nd', '物料明细.辅助单位');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608143')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608143', '921859854170220544', '16', '次辅单位', 'unit3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608144')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608144', '921859854170220544', '17', '生产日期', 'producedate', '0', ' ', ' ', 'billentry.producedate', '物料明细.生产日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608145')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608145', '921859854170220544', '18', '有效期至', 'expirydate', '0', ' ', ' ', 'billentry.expirydate', '物料明细.到期日期');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608146')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608146', '921859854170220544', '19', '物料名称', 'materialname', '0', ' ', ' ', 'billentry.material.number', '物料明细.物料编码.编码');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608147')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608147', '921859854170220544', '20', '库存类型', 'invtype', '0', ' ', ' ', 'billentry.invtype', '物料明细.退库库存类型');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608148')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608148', '921859854170220544', '21', '项目', 'project', '0', ' ', ' ', 'billentry.project', '物料明细.项目');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608149')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608149', '921859854170220544', '22', '库存量(基本单位)', 'baseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608150')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608150', '921859854170220544', '23', '库存量(库存单位)', 'qty', '0', ' ', ' ', 'billentry.qty', '物料明细.退库数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608151')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608151', '921859854170220544', '24', '库存量(辅助单位)', 'qty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608152')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608152', '921859854170220544', '25', '库存量(次辅单位)', 'qty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608153')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608153', '921859854170220544', '26', '锁库量(基本单位)', 'lockbaseqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608154')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608154', '921859854170220544', '27', '锁库量(库存单位)', 'lockqty', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608155')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608155', '921859854170220544', '28', '锁库量(辅助单位)', 'lockqty2nd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608156')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608156', '921859854170220544', '29', '锁库量(次辅单位)', 'lockqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608157')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608157', '921859854170220544', '30', '可用量(基本单位)', 'avbbaseqty', '0', ' ', ' ', 'billentry.baseqty', '物料明细.基本数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608158')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608158', '921859854170220544', '31', '可用量(库存单位)', 'avbqty', '0', ' ', ' ', 'billentry.qty', '物料明细.退库数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608159')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608159', '921859854170220544', '32', '可用量(辅助单位)', 'avbqty2nd', '0', ' ', ' ', 'billentry.qtyunit2nd', '物料明细.辅助数量');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608160')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608160', '921859854170220544', '33', '可用量(次辅单位)', 'avbqty3rd', '0', ' ', ' ', ' ', ' ');

IF NOT EXISTS (SELECT 1 FROM t_plat_dymaccdsmappentry WHERE FENTRYID = '921859854178608161')
insert into t_plat_dymaccdsmappentry (FENTRYID, FID, FSEQ, FTARGETFIELDNAME, FTARGETFIELD, FCONVERTTYPE, FFIELDFORMULA, FFIELDFORMULADESC, FSOURCEFIELD, FSOURCEFIELDNAME)
values ('921859854178608161', '921859854170220544', '34', '批号', 'lotnum', '0', ' ', ' ', 'billentry.lotnumber', '物料明细.批号');
