liyong
2026-04-15 4e7cc75a569c4e3ec31343fc5cec9db48b7acb0b
src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -19,6 +19,9 @@
            <if test="ew.qualitity != null">
                qualitity = qualitity + #{ew.qualitity},
            </if>
            <if test="ew.subQualitity != null">
                sub_qualitity = sub_qualitity + #{ew.subQualitity},
            </if>
            <if test="ew.version != null">
                version = version + 1,
            </if>
@@ -30,6 +33,15 @@
            </if>
            <if test="ew.lockedQuantity != null and ew.lockedQuantity !=''">
                locked_quantity = locked_quantity + #{ew.lockedQuantity},
            </if>
            <if test="ew.warehouseCode != null and ew.warehouseCode !=''">
                warehouse_code = #{ew.warehouseCode},
            </if>
            <if test="ew.warehouseName != null and ew.warehouseName !=''">
                warehouse_name = #{ew.warehouseName},
            </if>
            <if test="ew.productCode != null and ew.productCode !=''">
                product_code = #{ew.productCode},
            </if>
            update_time = now()
        </set>
@@ -73,6 +85,7 @@
        )
        select si.id,
        si.qualitity,
        si.sub_qualitity,
        COALESCE(si.locked_quantity, 0) as locked_quantity,
        si.product_model_id,
        si.create_time,
@@ -82,7 +95,11 @@
        (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity,
        pm.model,
        si.remark,
        si.warehouse_code,
        si.warehouse_name,
        si.product_code,
        pm.unit,
        pm.sub_unit,
        p.product_name
        from stock_inventory si
        left join product_model pm on si.product_model_id = pm.id