All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mappers.SortSourceConfigEntityMapper.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements. See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership. The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License. You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.inlong.manager.dao.mapper.SortSourceConfigEntityMapper">
  <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="cluster_name" jdbcType="VARCHAR" property="clusterName" />
    <result column="task_name" jdbcType="VARCHAR" property="taskName" />
    <result column="zone_name" jdbcType="VARCHAR" property="zoneName" />
    <result column="topic" jdbcType="VARCHAR" property="topic" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    <result column="ext_params" jdbcType="LONGVARCHAR" property="extParams" />
  </resultMap>
  <sql id="Base_Column_List">
    id, cluster_name, task_name, zone_name, topic
  </sql>
  <sql id="Blob_Column_List">
    ext_params
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sort_source_config
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from sort_source_config
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    insert into sort_source_config (id, cluster_name, task_name, 
      zone_name, topic, ext_params
      )
    values (#{id,jdbcType=INTEGER}, #{clusterName,jdbcType=VARCHAR}, #{taskName,jdbcType=VARCHAR}, 
      #{zoneName,jdbcType=VARCHAR}, #{topic,jdbcType=VARCHAR}, #{extParams,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    insert into sort_source_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="clusterName != null">
        cluster_name,
      </if>
      <if test="taskName != null">
        task_name,
      </if>
      <if test="zoneName != null">
        zone_name,
      </if>
      <if test="topic != null">
        topic,
      </if>
      <if test="extParams != null">
        ext_params,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="clusterName != null">
        #{clusterName,jdbcType=VARCHAR},
      </if>
      <if test="taskName != null">
        #{taskName,jdbcType=VARCHAR},
      </if>
      <if test="zoneName != null">
        #{zoneName,jdbcType=VARCHAR},
      </if>
      <if test="topic != null">
        #{topic,jdbcType=VARCHAR},
      </if>
      <if test="extParams != null">
        #{extParams,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    update sort_source_config
    <set>
      <if test="clusterName != null">
        cluster_name = #{clusterName,jdbcType=VARCHAR},
      </if>
      <if test="taskName != null">
        task_name = #{taskName,jdbcType=VARCHAR},
      </if>
      <if test="zoneName != null">
        zone_name = #{zoneName,jdbcType=VARCHAR},
      </if>
      <if test="topic != null">
        topic = #{topic,jdbcType=VARCHAR},
      </if>
      <if test="extParams != null">
        ext_params = #{extParams,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    update sort_source_config
    set cluster_name = #{clusterName,jdbcType=VARCHAR},
      task_name = #{taskName,jdbcType=VARCHAR},
      zone_name = #{zoneName,jdbcType=VARCHAR},
      topic = #{topic,jdbcType=VARCHAR},
      ext_params = #{extParams,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
    update sort_source_config
    set cluster_name = #{clusterName,jdbcType=VARCHAR},
      task_name = #{taskName,jdbcType=VARCHAR},
      zone_name = #{zoneName,jdbcType=VARCHAR},
      topic = #{topic,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>

  <select id="selectByClusterAndTask" resultMap="ResultMapWithBLOBs">
    select
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sort_source_config
    where cluster_name = #{clusterName,jdbcType=VARCHAR}
    AND task_name = #{taskName,jdbcType=VARCHAR}
  </select>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy