Select sum(u1.FQty) as qty From ICInventory u1
left join t_ICItem t1 on u1.FItemID = t1.FItemID
left join t_Stock t2 on u1.FStockID=t2.FItemID
left join t_MeasureUnit t3 on t1.FUnitID=t3.FMeasureUnitID
left join t_MeasureUnit t4 on t1.FStoreUnitID=t4.FMeasureUnitID
left join t_StockPlace t5 on u1.FStockPlaceID=t5.FSPID
left join t_AuxItem t9 on u1.FAuxPropID=t9.FItemID
left join t_Measureunit t19 on t1.FSecUnitID=t19.FMeasureunitID
where (Round(u1.FQty,t1.FQtyDecimal)<>0 OR Round(u1.FQty/t4.FCoefficient,t1.FQtyDecimal)<>0)
and t1.FDeleted=0 AND t2.FTypeID in (500,20291,20293) and t2.FName = '仓库名称' and t1.fnumber = ?
Order By t1.FNumber,u1.FBatchNo