<?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.kuaishou.modules.ai.mapper.KuaishouPopulationGroupMapper">

    <delete id="deleteByUnitId">
        DELETE
        FROM ctop_kuaishou_population_group
        WHERE unit_id = #{unitId}
    </delete>

    <insert id="replaceBatch">
        replace into ctop_kuaishou_population_group(
        id,
        account_id,
        unit_id,
        orientation_id
        )
        values
        <foreach collection="list" item="pop" separator=",">
            (
            #{pop.id},
            #{pop.accountId},
            #{pop.unitId},
            #{pop.orientationId}
            )
        </foreach>
    </insert>

</mapper>