package com.bailuntec.balancesheet.mapper;

import com.bailuntec.balancesheet.dto.SemiSkuDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DcSemiSkuMapper {
    @Insert("<script>" +
            "insert into dc_semi_sku(sku_code,sku_name,update_time) values" +
            "<foreach collection='list' item='item' index='index' separator=','>" +
            "(#{item.skuCode},#{item.skuName},#{item.updateTime})" +
            "</foreach>" +
            "on duplicate key update sku_name=values(sku_name),update_time=values(update_time)" +
            "</script>")
    void insertOrUpdateSemiSku(List<SemiSkuDTO> semiSkuDTOList);
}