<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.ctop.toutiao.modules.material.mapper.ByteDanceCreativeWordPackageMapper">

    <insert id="replaceBatch">
        replace into ctop_bytedance_creative_word_package(
        creative_word_id,
        name,
        default_word,
        words,
        content_type,
        max_word_len,
        status,
        user_rate)
        values
        <foreach collection="creativeWordPackages" item="report" separator=",">
            (
            #{report.creativeWordId},
            #{report.name},
            #{report.defaultWord},
            #{report.words},
            #{report.contentType},
            #{report.maxWordLen},
            #{report.status},
            #{report.userRate}
            )
        </foreach>
    </insert>

    <select id="selectCreativeWordPackageByName" resultType="cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreativeWordPackage">
        select * from ctop_bytedance_creative_word_package where name = #{name}
    </select>

</mapper>
