package com.hfkj.dao;

import com.hfkj.entity.CouponDiscountGoodsRel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * mapper扩展类
 */
public interface CouponDiscountGoodsRelMapperExt {

    @Insert({
            "<script>",
            "insert into coupon_discount_goods_rel (discount_id, create_time, ",
            "specs_id, `status`, ",
            "ext_1, ext_2, ext_3)",
            "values ",
            "<foreach collection='list' item='item' index='index' separator=','>",
            "(" +
                "#{item.discountId,jdbcType=BIGINT}, " +
                "#{item.createTime,jdbcType=TIMESTAMP}, ",
                "#{item.specsId,jdbcType=BIGINT}, " +
                "#{item.status,jdbcType=INTEGER}, " +
                "#{item.ext1,jdbcType=VARCHAR}, " +
                "#{item.ext2,jdbcType=VARCHAR}, ",
                "#{item.ext3,jdbcType=VARCHAR}" +
                        ")",
            "</foreach>",
            "</script>"
    })
    void insertGoodsRelBatch(@Param(value = "list") List<CouponDiscountGoodsRel> list);
}