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

mappers.StreamTransformEntityMapper.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.StreamTransformEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        <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="transform_name" jdbcType="VARCHAR" property="transformName"/>
        <result column="transform_type" jdbcType="VARCHAR" property="transformType"/>
        <result column="pre_node_names" jdbcType="VARCHAR" property="preNodeNames"/>
        <result column="post_node_names" jdbcType="VARCHAR" property="postNodeNames"/>
        <result column="transform_definition" jdbcType="VARCHAR" property="transformDefinition"/>
        <result column="version" jdbcType="INTEGER" property="version"/>
        <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
        <result column="creator" jdbcType="VARCHAR" property="creator"/>
        <result column="modifier" jdbcType="VARCHAR" property="modifier"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, inlong_group_id, inlong_stream_id, transform_name, transform_type, pre_node_names, post_node_names,
        transform_definition, version, is_deleted, creator, modifier, create_time, modify_time
    </sql>
    <insert id="insert" useGeneratedKeys="true" keyProperty="id"
            parameterType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        insert into stream_transform (id, inlong_group_id, inlong_stream_id,
                                      transform_name, transform_type, pre_node_names,
                                      post_node_names, transform_definition,
                                      creator, modifier)
        values (#{id,jdbcType=INTEGER}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR},
                #{transformName,jdbcType=VARCHAR}, #{transformType,jdbcType=VARCHAR}, #{preNodeNames,jdbcType=VARCHAR},
                #{postNodeNames,jdbcType=VARCHAR}, #{transformDefinition,jdbcType=VARCHAR},
                #{creator,jdbcType=VARCHAR}, #{modifier,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
            parameterType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        insert into stream_transform
        <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="transformName != null">
                transform_name,
            </if>
            <if test="transformType != null">
                transform_type,
            </if>
            <if test="preNodeNames != null">
                pre_node_names,
            </if>
            <if test="postNodeNames != null">
                post_node_names,
            </if>
            <if test="transformDefinition != null">
                transform_definition,
            </if>
            <if test="creator != null">
                creator,
            </if>
            <if test="modifier != null">
                modifier,
            </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="transformName != null">
                #{transformName,jdbcType=VARCHAR},
            </if>
            <if test="transformType != null">
                #{transformType,jdbcType=VARCHAR},
            </if>
            <if test="preNodeNames != null">
                #{preNodeNames,jdbcType=VARCHAR},
            </if>
            <if test="postNodeNames != null">
                #{postNodeNames,jdbcType=VARCHAR},
            </if>
            <if test="transformDefinition != null">
                #{transformDefinition,jdbcType=VARCHAR},
            </if>
            <if test="creator != null">
                #{creator,jdbcType=VARCHAR},
            </if>
            <if test="modifier != null">
                #{modifier,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>

    <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from stream_transform
        where id = #{id,jdbcType=INTEGER}
    </select>
    <select id="selectByRelatedId" resultType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        select
        <include refid="Base_Column_List"/>
        from stream_transform
        <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>
            <if test="transformName != null and transformName != ''">
                and transform_name = #{transformName, jdbcType=VARCHAR}
            </if>
        </where>
    </select>

    <select id="selectByCondition"
            parameterType="org.apache.inlong.manager.pojo.transform.TransformPageRequest"
            resultType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        select
        <include refid="Base_Column_List"/>
        from stream_transform
        <where>
            is_deleted = 0
            and inlong_group_id = #{request.inlongGroupId, jdbcType=VARCHAR}
            <if test="request.inlongStreamId != null and request.inlongStreamId != ''">
                and inlong_stream_id = #{request.inlongStreamId, jdbcType=VARCHAR}
            </if>
            <if test="request.transformType != null and request.transformType != ''">
                and transform_type = #{request.transformType, jdbcType=VARCHAR}
            </if>
            <if test="request.transformName != null and request.transformName != ''">
                and transform_name = #{request.transformName, jdbcType=VARCHAR}
            </if>
        </where>
    </select>

    <update id="updateById" parameterType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        update stream_transform
        set inlong_group_id      = #{inlongGroupId,jdbcType=VARCHAR},
            inlong_stream_id     = #{inlongStreamId,jdbcType=VARCHAR},
            transform_name       = #{transformName,jdbcType=VARCHAR},
            transform_type       = #{transformType,jdbcType=VARCHAR},
            pre_node_names       = #{preNodeNames,jdbcType=VARCHAR},
            post_node_names      = #{postNodeNames,jdbcType=VARCHAR},
            transform_definition = #{transformDefinition,jdbcType=VARCHAR},
            version              = #{version,jdbcType=INTEGER} + 1,
            is_deleted           = #{isDeleted,jdbcType=INTEGER},
            creator              = #{creator,jdbcType=VARCHAR},
            modifier             = #{modifier,jdbcType=VARCHAR}
        where id = #{id,jdbcType=INTEGER}
        and version = #{version,jdbcType=INTEGER}
    </update>
    <update id="updateByIdSelective" parameterType="org.apache.inlong.manager.dao.entity.StreamTransformEntity">
        update stream_transform
        <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="transformName != null">
                transform_name = #{transformName,jdbcType=VARCHAR},
            </if>
            <if test="transformType != null">
                transform_type = #{transformType,jdbcType=VARCHAR},
            </if>
            <if test="preNodeNames != null">
                pre_node_names = #{preNodeNames,jdbcType=VARCHAR},
            </if>
            <if test="postNodeNames != null">
                post_node_names = #{postNodeNames,jdbcType=VARCHAR},
            </if>
            <if test="transformDefinition != null">
                transform_definition = #{transformDefinition,jdbcType=VARCHAR},
            </if>
            <if test="isDeleted != null">
                is_deleted = #{isDeleted,jdbcType=INTEGER},
            </if>
            <if test="creator != null">
                creator = #{creator,jdbcType=VARCHAR},
            </if>
            <if test="modifier != null">
                modifier = #{modifier,jdbcType=VARCHAR},
            </if>
            version = #{version,jdbcType=INTEGER} + 1
        </set>
        where id = #{id,jdbcType=INTEGER}
        and version = #{version,jdbcType=INTEGER}
    </update>

    <delete id="deleteById" parameterType="java.lang.Integer">
        delete
        from stream_transform
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <delete id="deleteByInlongGroupIds">
        delete
        from stream_transform
        where inlong_group_id in
        <foreach item="item" index="index" collection="groupIdList" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </delete>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy