liding
2 天以前 b28173836631e9ecb1aafbaa5786c0383462208e
src/main/resources/mapper/stock/StockUninventoryMapper.xml
@@ -44,27 +44,32 @@
        where product_model_id = #{ew.productModelId}
    </update>
    <select id="pageStockUninventory" resultType="com.ruoyi.stock.dto.StockUninventoryDto">
        select su.id,
        SELECT
        su.id,
        su.qualitity,
        COALESCE(su.locked_quantity, 0) as locked_quantity,
        COALESCE(su.locked_quantity, 0) AS locked_quantity,
        su.product_model_id,
        su.create_time,
        su.update_time,
        su.version,
        su.update_time,
        (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity,
        (su.qualitity - COALESCE(su.locked_quantity, 0)) AS un_locked_quantity,
        pm.model,
        pm.unit,
        p.product_name
        from stock_uninventory su
        left join product_model pm on su.product_model_id = pm.id
        left join product p on pm.product_id = p.id
        where 1 = 1
        p.product_name,
        p2.product_name AS parent_name
        FROM
        stock_uninventory su
        LEFT JOIN product_model pm ON su.product_model_id = pm.id
        LEFT JOIN product p ON pm.product_id = p.id
        LEFT JOIN product p2 ON p.parent_id = p2.id
        WHERE
        1 = 1
        AND (p2.product_name != '半成品' OR p2.product_name IS NULL)
        <if test="ew.productName != null and ew.productName !=''">
            and p.product_name like concat('%',#{ew.productName},'%')
        </if>
    </select>
    <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
    <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockUnInventoryExportData">
        select su.*,
        pm.model,
        pm.unit,