<?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.live.mapper.LiveDataMaterialMapper">

    <insert id="replaceBatch">
        replace into ctop_live_data_material(
        id,
        account_id,
        stat_date,
        video_id,
        charge,
        shows,
        photo_show,
        photo_click_ratio,
        aclick,
        bclick,
        action_ratio,
        likes,
        shares,
        comments,
        photo_url,
        video_url,
        play_3s_count,
        event_appoint_success,
        live_watch_count,
        live_order_count,
        live_gmv,
        live_roi,
        live_fans,
        live_next_day_fans,
        live_next_day_fans_roi,
        live_fans_7d,
        live_fans_7d_roi,
        live_fans_15d,
        live_fans_15d_roi
        )
        values
        <foreach collection="list" item="material" separator=",">
            (
            #{material.id},
            #{material.accountId},
            #{material.statDate},
            #{material.videoId},
            #{material.charge},
            #{material.shows},
            #{material.photoShow},
            #{material.photoClickRatio},
            #{material.aclick},
            #{material.bclick},
            #{material.actionRatio},
            #{material.likes},
            #{material.shares},
            #{material.comments},
            #{material.photoUrl},
            #{material.videoUrl},
            #{material.play3sCount},
            #{material.eventAppointSuccess},
            #{material.liveWatchCount},
            #{material.liveOrderCount},
            #{material.liveGmv},
            #{material.liveRoi},
            #{material.liveFans},
            #{material.liveNextDayFans},
            #{material.liveNextDayFansRoi},
            #{material.liveFans7d},
            #{material.liveFans7dRoi},
            #{material.liveFans15d},
            #{material.liveFans15dRoi}
            )
        </foreach>
    </insert>

    <insert id="replaceEntity">
        replace into ctop_live_data_material(
        id,
        account_id,
        stat_date,
        video_id,
        charge,
        shows,
        photo_show,
        photo_click_ratio,
        aclick,
        bclick,
        action_ratio,
        likes,
        shares,
        comments,
        photo_url,
        video_url,
        play_3s_count,
        event_appoint_success,
        live_watch_count,
        live_order_count,
        live_gmv,
        live_roi,
        live_fans,
        live_next_day_fans,
        live_next_day_fans_roi,
        live_fans_7d,
        live_fans_7d_roi,
        live_fans_15d,
        live_fans_15d_roi
        )
        values
            (
            #{material.id},
            #{material.accountId},
            #{material.statDate},
            #{material.videoId},
            #{material.charge},
            #{material.shows},
            #{material.photoShow},
            #{material.photoClickRatio},
            #{material.aclick},
            #{material.bclick},
            #{material.actionRatio},
            #{material.likes},
            #{material.shares},
            #{material.comments},
            #{material.photoUrl},
            #{material.videoUrl},
            #{material.play3sCount},
            #{material.eventAppointSuccess},
            #{material.liveWatchCount},
            #{material.liveOrderCount},
            #{material.liveGmv},
            #{material.liveRoi},
            #{material.liveFans},
            #{material.liveNextDayFans},
            #{material.liveNextDayFansRoi},
            #{material.liveFans7d},
            #{material.liveFans7dRoi},
            #{material.liveFans15d},
            #{material.liveFans15dRoi}
            )
    </insert>

</mapper>