<?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="com.xiaojukeji.know.streaming.km.persistence.mysql.config.PlatformClusterConfigDAO">
  <resultMap id="PlatformClusterConfigMap"  type="com.xiaojukeji.know.streaming.km.common.bean.po.config.PlatformClusterConfigPO">
    <id column="id"                         property="id" />
    <result column="create_time"            property="createTime" />
    <result column="update_time"            property="updateTime" />

    <result column="cluster_id"             property="clusterId" />
    <result column="value_group"            property="valueGroup" />
    <result column="value_name"             property="valueName" />
    <result column="value"                  property="value" />
    <result column="description"            property="description" />
    <result column="operator"               property="operator" />
  </resultMap>

  <insert id="batchReplace" parameterType="java.util.List">
    REPLACE INTO ks_km_platform_cluster_config (
        cluster_id,
        `value_group`,
        `value_name`,
        `value`,
        description,
        operator
    ) VALUES
    <foreach collection="list" item="item" index="index" separator=",">
    (
        #{item.clusterId},
        #{item.valueGroup},
        #{item.valueName},
        #{item.value},
        #{item.description},
        #{item.operator}
    )
    </foreach>
  </insert>
</mapper>