package com.vote.system.mapper;

import com.vote.system.domain.VoteSubmissionItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【vote_submission_item(规则项和作品关联表)】的数据库操作Mapper
 * @createDate 2024-09-03 18:14:43
 * @Entity com.vote.system.domain.VoteSubmissionItem
 */
public interface VoteSubmissionItemMapper extends BaseMapper<VoteSubmissionItem> {

    /**
     * 批量插入VoteSubmissionItem记录
     *
     * @param itemList 要插入的VoteSubmissionItem记录列表
     * @return 插入的记录数
     */
    @Insert({
            "<script>",
            "INSERT INTO vote_submission_item (submission_id, item_id, score) VALUES ",
            "<foreach collection='itemList' item='itemList' separator=','>",
            "(#{itemList.submissionId}, #{itemList.itemId}, #{itemList.score})",
            "</foreach>",
            "</script>"
    })
    int insertBatch(@Param("itemList") List<VoteSubmissionItem> itemList);
}




