-- 更新关联字段和查询字段
UPDATE T_IM_BGSETENTRY SET FSELFIELD = 'id as dest_bizbillid,billentry.id as dest_bizentryid,billno as dest_billno,bookdate as dest_bookdate,biztime as dest_bizdate,billentry.material.masterid as dest_material,billentry.outowner as dest_owner,billentry.baseqty as dest_baseqty,''im_mdc_omreturnbill'' as dest_formid,ischargeoffed as dest_ischargeoffed,''0'' as dest_islastentry,billentry.srcbillid,billentry.outowner,billentry.srcbillentryid',FRELFIELD = 'billentry.srcbillid,billentry.outowner,billentry.srcbillentryid' WHERE FENTRYID =1712203369814176769;
UPDATE T_IM_BGSETENTRY SET FSELFIELD = 'id as src_bizbillid,billentry.id as src_bizentryid,billno as src_billno,bookdate as src_bookdate,biztime as src_bizdate,billentry.material.masterid as src_material,billentry.outowner as src_owner,billentry.baseqty as src_baseqty,''im_mdc_omoutbill'' as src_formid,ischargeoffed as src_ischargeoffed,''0'' as src_islastentry,id,billentry.outowner,billentry.id',FRELFIELD = 'id,billentry.outowner,billentry.id'  WHERE FENTRYID = 1712203369814176768;

-- 删除所有的关联字段分录，重新插入
DELETE FROM T_IM_BGSETRENTRY WHERE FID = 1712203369528964096;
INSERT INTO T_IM_BGSETRENTRY(FID,FFIELDKEY0,FFIELDKEY1,FENTRYID,FFIELDKEY2,FFIELDKEY3,FFIELDKEY4,FFIELDNAME4,FFIELDNAME3,FFIELDNAME2,FFIELDNAME1,FFIELDNAME0,FSEQ) VALUES (1712203369528964096,'billentry.id','srcbillentryid',1929864423174958080,' ',' ',' ',' ',' ',' ','物料明细.来源单据行ID','物料明细.id',3);
INSERT INTO T_IM_BGSETRENTRY(FID,FFIELDKEY0,FFIELDKEY1,FENTRYID,FFIELDKEY2,FFIELDKEY3,FFIELDKEY4,FFIELDNAME4,FFIELDNAME3,FFIELDNAME2,FFIELDNAME1,FFIELDNAME0,FSEQ) VALUES (1712203369528964096,'outowner','outowner',1712203369814176771,' ',' ',' ',' ',' ',' ','物料明细.出库货主','物料明细.出库货主',2);
INSERT INTO T_IM_BGSETRENTRY(FID,FFIELDKEY0,FFIELDKEY1,FENTRYID,FFIELDKEY2,FFIELDKEY3,FFIELDKEY4,FFIELDNAME4,FFIELDNAME3,FFIELDNAME2,FFIELDNAME1,FFIELDNAME0,FSEQ) VALUES (1712203369528964096,'id','srcbillid',1712203369814176770,' ',' ',' ',' ',' ',' ','物料明细.来源单据ID','单据头.id',1);