update GodownEntryDiposableGoodsItem set price = (select price from DisposableGoodsIdentification where id=GodownEntryDiposableGoodsItem.identificationID) where identificationID is not null;
update GodownEntryDiposableGoodsItem set price = (select price from ExpensiveDisposablegoods where id=GodownEntryDiposableGoodsItem.expensiveDisposableGoodsId) where expensiveDisposableGoodsId is not null;
update GodownEntry set orgUnitCode=(select orgUnitCode from WareHouse where id=GodownEntry.warehouseID);
update GodownEntry set orgUnitName=(select orgUnitName from WareHouse where id=GodownEntry.warehouseID);
update GodownEntry set targetWareHouseId=(select ge2.targetWareHouseId from GodownEntry ge2 where ge2.id=GodownEntry.sourceId) where subType='调拨出库' and targetWareHouseId is null;
update GodownEntry set targetWareHouseName=(select ge2.targetWareHouseName from GodownEntry ge2 where ge2.id=GodownEntry.sourceId) where subType='调拨出库' and targetWareHouseName is null;
update GodownEntry set targetorgUnitCode=(select orgUnitCode from WareHouse where id=GodownEntry.targetWareHouseId) where targetWareHouseId is not null;
update GodownEntry set targetorgUnitName=(select orgUnitName from WareHouse where id=GodownEntry.targetWareHouseId) where targetWareHouseId is not null;
update UseDiposableGoodsItem set disposableGoodsId= (
select db.diposablegoods_id from barcodeDevice b join DisposableGoodsBatch db on db.id=b.id 
where UseDiposableGoodsItem.barcode=b.barcode 
)where disposableGoodsId is null;
update UseDiposableGoodsItem set disposableGoodsId= (
select eg.disposableGoodsID from barcodeDevice b join ExpensiveDisposablegoods eg on eg.id=b.id 
where UseDiposableGoodsItem.barcode=b.barcode 
)where disposableGoodsId is null;
UPDATE GodownEntryDiposableGoodsItem
   SET goodsName = (SELECT 
	CASE 
	WHEN specification=''        THEN name
	WHEN specification is null   THEN name
	ELSE name + '['+specification+']' END
  FROM DisposableGoods where id= disposableGoodsID)
   WHERE goodsName is null and disposableGoodsID is not null;