package shop.alien.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import shop.alien.entity.store.TagsSynonym;

import java.util.List;

/**
 * qxy
 * AI 服务标签子表
 */

@Mapper
public interface TagsSynonymMapper extends BaseMapper<TagsSynonym> {

    @Insert({
            "<script>", // 开启动态 SQL 脚本
            "INSERT INTO tags_synonym (",
            "  id, main_tag_id, comment_id, synonym_tag, delete_flag, created_time, created_user_id,",
            "  updated_time, updated_user_id, tag_type, task_id",
            ")",
            "VALUES",
            "<foreach collection='list' item='item' separator=','>",
            "(",
            "  #{item.id},",
            "  #{item.mainTagId},",
            "  #{item.commentId},",
            "  #{item.synonymTag},",
            "  #{item.deleteFlag},",
            "  #{item.createdTime},",
            "  #{item.createdUserId},",
            "  #{item.updatedTime},",
            "  #{item.updatedUserId},",
            "  #{item.tagType},",
            "  #{item.taskId}",
            ")",
            "</foreach>",
            "</script>" // 关闭动态 SQL 脚本
    })
    int insertBatchTagsSynonym(List<TagsSynonym> tagsSynonymList);
}
