package com.hfkj.dao;

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

import java.util.List;

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

    @Insert({"<script>" +
            " insert into bs_discount_stock_code (discount_stock_batch_id, discount_stock_batch_no," +
            " discount_id, discount_no, discount_name, `status`, create_time, update_time, ext_1, ext_2, ext_3) " +
            " VALUES " +
            " <foreach collection='list' item='item' index='index' separator=','>" +
            " (#{item.discountStockBatchId}, " +
            " #{item.discountStockBatchNo}," +
            " #{item.discountId}," +
            " #{item.discountNo}," +
            " #{item.discountName}," +
            " #{item.status}," +
            " #{item.createTime}," +
            " #{item.updateTime}," +
            " #{item.ext1}," +
            " #{item.ext2}, " +
            " #{item.ext3})" +
            " </foreach>" +
            " </script>"})
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insertList(@Param("list") List<BsDiscountStockCode> codeList);

}
