<?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.goods.mapper.BizGoodsPicMapper">

    <select id="selectPicUrlsByGoodsId" resultType="java.lang.String">
        select pic_url
        from biz_goods_pic
        where goods_id = #{goodsId}
          and del_flag = '0'
        order by sort_no asc, pic_id asc
    </select>

    <delete id="deleteByGoodsId">
        delete from biz_goods_pic where goods_id = #{goodsId}
    </delete>

    <insert id="batchInsert">
        insert into biz_goods_pic (goods_id, pic_url, sort_no, del_flag, create_by, create_time)
        values
        <foreach collection="list" item="item" separator=",">
            (#{item.goodsId}, #{item.picUrl}, #{item.sortNo}, #{item.delFlag},
             #{item.createBy}, #{item.createTime})
        </foreach>
    </insert>
</mapper>
