<?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="org.jeecg.modules.ctop.mapper.JhsBakendDataMapper">

    <insert id="replaceData">
        REPLACE INTO
            ctop_jhs_bakend_data
            (id,state_date,
            product_line,
            task_name,
            client_name,
            channel_id,
            channel_name,
            ad_id,
            page_view,
            deal_number)
            VALUES(
                #{bakendData.id},
                #{bakendData.stateDate},
                #{bakendData.productLine},
                #{bakendData.taskName},
                #{bakendData.clientName},
                #{bakendData.channelId},
                #{bakendData.channelName},
                #{bakendData.adId},
                #{bakendData.pageView},
                #{bakendData.dealNumber}
                )
    </insert>
    <insert id="replaceBatch">
        REPLACE INTO
        ctop_jhs_bakend_data
        (id,state_date,
        product_line,
        task_name,
        client_name,
        channel_id,
        channel_name,
        ad_id,
        page_view,
        vistor,
        deal_number)
            values
            <foreach collection="datas" item="bakendData" separator=",">
                (
                '${bakendData.adId}${bakendData.stateDate}${bakendData.clientName}${bakendData.channelId}',
                #{bakendData.stateDate},
                #{bakendData.productLine},
                #{bakendData.taskName},
                #{bakendData.clientName},
                #{bakendData.channelId},
                #{bakendData.channelName},
                #{bakendData.adId},
                #{bakendData.pageView},
                #{bakendData.vistor},
                #{bakendData.dealNumber}
                )
            </foreach>
    </insert>
</mapper>
