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

mappers.InlongStreamExtEntityMapper.xml Maven / Gradle / Ivy

<?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.InlongStreamExtEntityMapper">
  <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId" />
    <result column="inlong_stream_id" jdbcType="VARCHAR" property="inlongStreamId" />
    <result column="key_name" jdbcType="VARCHAR" property="keyName" />
    <result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    <result column="key_value" jdbcType="LONGVARCHAR" property="keyValue" />
  </resultMap>
  <sql id="Base_Column_List">
    id, inlong_group_id, inlong_stream_id, key_name, is_deleted, modify_time
  </sql>
  <sql id="Blob_Column_List">
    key_value
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from inlong_stream_ext
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from inlong_stream_ext
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    insert into inlong_stream_ext (id, inlong_group_id, inlong_stream_id, 
      key_name, is_deleted, modify_time, 
      key_value)
    values (#{id,jdbcType=INTEGER}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR}, 
      #{keyName,jdbcType=VARCHAR}, #{isDeleted,jdbcType=INTEGER}, #{modifyTime,jdbcType=TIMESTAMP}, 
      #{keyValue,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    insert into inlong_stream_ext
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="inlongGroupId != null">
        inlong_group_id,
      </if>
      <if test="inlongStreamId != null">
        inlong_stream_id,
      </if>
      <if test="keyName != null">
        key_name,
      </if>
      <if test="isDeleted != null">
        is_deleted,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="keyValue != null">
        key_value,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="inlongGroupId != null">
        #{inlongGroupId,jdbcType=VARCHAR},
      </if>
      <if test="inlongStreamId != null">
        #{inlongStreamId,jdbcType=VARCHAR},
      </if>
      <if test="keyName != null">
        #{keyName,jdbcType=VARCHAR},
      </if>
      <if test="isDeleted != null">
        #{isDeleted,jdbcType=INTEGER},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="keyValue != null">
        #{keyValue,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    update inlong_stream_ext
    <set>
      <if test="inlongGroupId != null">
        inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
      </if>
      <if test="inlongStreamId != null">
        inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
      </if>
      <if test="keyName != null">
        key_name = #{keyName,jdbcType=VARCHAR},
      </if>
      <if test="isDeleted != null">
        is_deleted = #{isDeleted,jdbcType=INTEGER},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="keyValue != null">
        key_value = #{keyValue,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    update inlong_stream_ext
    set inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
      inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
      key_name = #{keyName,jdbcType=VARCHAR},
      is_deleted = #{isDeleted,jdbcType=INTEGER},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      key_value = #{keyValue,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    update inlong_stream_ext
    set inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR},
      inlong_stream_id = #{inlongStreamId,jdbcType=VARCHAR},
      key_name = #{keyName,jdbcType=VARCHAR},
      is_deleted = #{isDeleted,jdbcType=INTEGER},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectByRelatedId" resultType="org.apache.inlong.manager.dao.entity.InlongStreamExtEntity">
    select
    <include refid="Base_Column_List"/>
    from inlong_stream_ext
    where inlong_group_id = #{groupId, jdbcType=VARCHAR}
    <if test="streamId != null and streamId != ''">
      and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
    </if>
    and is_deleted = 0
  </select>
  <!-- Bulk insert-->
  <insert id="insertAll" parameterType="java.util.List">
    insert into inlong_stream_ext
    (id, inlong_group_id, inlong_stream_id, key_name, key_value, is_deleted)
    values
    <foreach collection="extList" separator="," index="index" item="item">
      (#{item.id}, #{item.inlongGroupId}, #{item.inlongStreamId}, #{item.keyName}, #{item.keyValue}, #{item.isDeleted})
    </foreach>
  </insert>
  <!-- Bulk insert,update if exists-->
  <insert id="insertOnDuplicateKeyUpdate" parameterType="java.util.List">
    insert into inlong_stream_ext
    (id, inlong_group_id, inlong_stream_id, key_name, key_value, is_deleted)
    values
    <foreach collection="extList" separator="," index="index" item="item">
      (#{item.id}, #{item.inlongGroupId}, #{item.inlongStreamId}, #{item.keyName}, #{item.keyValue}, #{item.isDeleted})
    </foreach>
    ON DUPLICATE KEY UPDATE
    inlong_group_id = VALUES(inlong_group_id),
    inlong_stream_id = VALUES(inlong_stream_id),
    key_name = VALUES(key_name),
    key_value = VALUES(key_value),
    is_deleted = VALUES(is_deleted)
  </insert>
  <delete id="deleteAllByRelatedId">
    delete
    from inlong_stream_ext
    where inlong_group_id = #{groupId, jdbcType=VARCHAR}
    <if test="streamId != null and streamId != ''">
      and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
    </if>
  </delete>
  <update id="logicDeleteAllByRelatedId">
    update inlong_stream_ext
    set is_deleted = 1
    where is_deleted = 0
    and inlong_group_id = #{groupId, jdbcType=VARCHAR}
    <if test="streamId != null and streamId != ''">
      and inlong_stream_id = #{streamId, jdbcType=VARCHAR}
    </if>
  </update>
</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy