select Site,PartNo,BatchNo from InventoryStock where Site=#{site} and partNo=#{partNo} and WarehouseID = #{warehouseId,jdbcType=VARCHAR} and #{batchNo}>BatchNo
and QtyOnHand>0
order by BatchNo
select Site,PartNo,BatchNo from InventoryStock where Site=#{site} and partNo=#{partNo} and WarehouseID = #{warehouseId} and
(select top 1 FirstInDate from InventoryStock where Site=#{site} and partNo=#{partNo} and WarehouseID = #{warehouseId} and BatchNo=#{batchNo} order by FirstInDate)>FirstInDate