<?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.cluster.ClusterPhyDAO">
  <resultMap id="ClusterPhyMap"           type="com.xiaojukeji.know.streaming.km.common.bean.po.cluster.ClusterPhyPO">
    <id column="id"                       property="id" />
    <result column="create_time"          property="createTime" />
    <result column="update_time"          property="updateTime" />

    <result column="name"                 property="name" />
    <result column="zookeeper"            property="zookeeper" />
    <result column="bootstrap_servers"    property="bootstrapServers" />
    <result column="kafka_version"        property="kafkaVersion" />
    <result column="client_properties"    property="clientProperties" />
    <result column="jmx_properties"       property="jmxProperties" />
    <result column="zk_properties"        property="zkProperties" />
    <result column="auth_type"            property="authType" />
    <result column="run_state"            property="runState" />
    <result column="description"          property="description" />
  </resultMap>

  <insert id="addAndSetId"
          parameterType="com.xiaojukeji.know.streaming.km.common.bean.po.cluster.ClusterPhyPO"
          useGeneratedKeys="true"
          keyProperty="id">
    INSERT INTO ks_km_physical_cluster
        (name, zookeeper, bootstrap_servers, kafka_version, client_properties, jmx_properties, zk_properties, description, auth_type, run_state)
    VALUES
        (#{name}, #{zookeeper}, #{bootstrapServers}, #{kafkaVersion}, #{clientProperties}, #{jmxProperties}, #{zkProperties}, #{description}, #{authType}, #{runState})
  </insert>
</mapper>