liding
2026-04-15 1d2d3760bef94013f80cae555bdcbfb2268929a2
src/main/resources/mapper/stock/StockUninventoryMapper.xml
@@ -23,6 +23,12 @@
            <if test="ew.remark != null and ew.remark !=''">
                remark = #{ew.remark},
            </if>
            <if test="ew.batchNo != null and ew.batchNo !=''">
                batch_no = #{ew.batchNo},
            </if>
            <if test="ew.customer != null and ew.customer !=''">
                customer = #{ew.customer},
            </if>
            update_time = now()
        </set>
        where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity}
@@ -39,24 +45,44 @@
            <if test="ew.remark != null and ew.remark !=''">
                remark = #{ew.remark},
            </if>
            <if test="ew.batchNo != null and ew.batchNo !=''">
                batch_no = #{ew.batchNo},
            </if>
            <if test="ew.customer != null and ew.customer !=''">
                customer = #{ew.customer},
            </if>
            <if test="ew.productionDate != null">
                production_date = #{ew.productionDate},
            </if>
            update_time = now()
        </set>
        where product_model_id = #{ew.productModelId}
    </update>
    <select id="pageStockUninventory" resultType="com.ruoyi.stock.dto.StockUninventoryDto">
        select su.*,
               pm.model,
               pm.unit,
               p.product_name
        select su.id,
        su.qualitity,
        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,
        pm.model,
        pm.unit,
        pm.uid_no,
        p.product_name,
        su.batch_no,
        su.customer
        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
        left join product_model pm on su.product_model_id = pm.id
        left join product p on pm.product_id = p.id
        where su.qualitity != 0
        <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,