gongchunyi
18 小时以前 02cf72a4443db4f1a2406c3919718c38aa6367db
src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -107,6 +107,7 @@
            MAX(warn_num) as warn_num,
            MAX(version) as version,
            model,
            thickness,
            MAX(remark) as remark,
            unit,
            product_name,
@@ -128,6 +129,7 @@
            si.version,
            (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity,
            pm.model,
            pm.thickness,
            si.remark,
            pm.unit,
            p.product_name,
@@ -153,6 +155,7 @@
            su.version,
            (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity,
            pm.model,
            pm.thickness,
            su.remark,
            pm.unit,
            p.product_name,
@@ -172,7 +175,7 @@
                and combined.product_id in (select id from product_tree)
            </if>
        </where>
        group by product_model_id, model, unit, product_name, product_id
        group by product_model_id, model, thickness, unit, product_name, product_id
    </select>
    <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
        WITH RECURSIVE product_tree AS (
@@ -192,6 +195,7 @@
            SUM(qualifiedLockedQuantity) as qualifiedLockedQuantity,
            SUM(unQualifiedLockedQuantity) as unQualifiedLockedQuantity,
            model,
            thickness,
            unit,
            product_name,
            MAX(warn_num) as warn_num,
@@ -209,6 +213,7 @@
            COALESCE(si.warn_num, 0) as warn_num,
            si.remark,
            pm.model,
            pm.thickness,
            pm.unit,
            p.product_name,
            p.id as product_id
@@ -229,6 +234,7 @@
            0 as warn_num,
            su.remark,
            pm.model,
            pm.thickness,
            pm.unit,
            p.product_name,
            p.id as product_id
@@ -247,8 +253,9 @@
                and combined.product_id in (select id from product_tree)
            </if>
        </where>
        group by product_model_id, model, unit, product_name
        group by product_model_id, model, thickness, unit, product_name
    </select>
    <select id="stockInventoryPage" resultType="com.ruoyi.stock.dto.StockInRecordDto">
        select sir.*,si.qualitity as current_stock,
        pm.model,