<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.web.modules.stock.mapper.BizStockOutboundItemMapper">

    <insert id="batchInsert">
        insert into biz_stock_outbound_item (outbound_id, goods_id, sku_id, goods_name, main_pic, spec_text,
                                             quantity, stock_before, stock_after)
        values
        <foreach collection="list" item="item" separator=",">
            (#{item.outboundId}, #{item.goodsId}, #{item.skuId}, #{item.goodsName}, #{item.mainPic}, #{item.specText},
             #{item.quantity}, #{item.stockBefore}, #{item.stockAfter})
        </foreach>
    </insert>

    <select id="selectByOutboundId" resultType="com.ruoyi.web.modules.stock.vo.StockOutboundItemVO">
        select item_id as itemId,
               goods_id as goodsId,
               sku_id as skuId,
               goods_name as goodsName,
               main_pic as mainPic,
               spec_text as specText,
               quantity as quantity,
               stock_before as stockBefore,
               stock_after as stockAfter
        from biz_stock_outbound_item
        where outbound_id = #{outboundId}
        order by item_id
    </select>
</mapper>
