liding
9 天以前 cf65d0a608b21f07dc50a98b864dfe47def4f86b
src/main/resources/mapper/consumables/ConsumablesInventoryMapper.xml
@@ -60,8 +60,7 @@
        select
        si.id,
        -- 当前净重 = 入库净重 - 出库净重
        (COALESCE(sir.total_net_weight,0) - COALESCE(sor.total_net_weight,0)) as net_weight,
        si.qualitity,
        (COALESCE(sir.total_net_weight,0) - COALESCE(sor.total_net_weight,0)) as qualitity,
        si.purchaser,
        COALESCE(si.locked_quantity, 0) as locked_quantity,
        si.product_model_id,
@@ -85,7 +84,7 @@
        left join (
        select
        product_model_id,
        sum(net_weight) as total_net_weight
        sum(stock_in_num) as total_net_weight
        from consumables_in_record
        group by product_model_id
        ) sir on si.product_model_id = sir.product_model_id
@@ -93,7 +92,7 @@
        left join (
        select
        product_model_id,
        sum(net_weight) as total_net_weight
        sum(stock_out_num) as total_net_weight
        from consumables_out_record
        group by product_model_id
        ) sor on si.product_model_id = sor.product_model_id