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

mappers.StreamTransformFieldEntityMapper.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.StreamTransformFieldEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        <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_id" jdbcType="INTEGER" property="transformId"/>
        <result column="transform_type" jdbcType="VARCHAR" property="transformType"/>
        <result column="field_name" jdbcType="VARCHAR" property="fieldName"/>
        <result column="field_value" jdbcType="VARCHAR" property="fieldValue"/>
        <result column="pre_expression" jdbcType="VARCHAR" property="preExpression"/>
        <result column="field_type" jdbcType="VARCHAR" property="fieldType"/>
        <result column="field_comment" jdbcType="VARCHAR" property="fieldComment"/>
        <result column="is_meta_field" jdbcType="SMALLINT" property="isMetaField"/>
        <result column="meta_field_name" jdbcType="VARCHAR" property="metaFieldName"/>
        <result column="field_format" jdbcType="VARCHAR" property="fieldFormat"/>
        <result column="origin_node_name" jdbcType="VARCHAR" property="originNodeName"/>
        <result column="origin_field_name" jdbcType="VARCHAR" property="originFieldName"/>
        <result column="rank_num" jdbcType="SMALLINT" property="rankNum"/>
        <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, inlong_group_id, inlong_stream_id, transform_id, transform_type, field_name,
        field_value, pre_expression, field_type, field_comment, is_meta_field, meta_field_name,
        field_format, origin_node_name, origin_field_name, rank_num, is_deleted
    </sql>
    <select id="selectByTransformId" resultType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        select
        <include refid="Base_Column_List"/>
        from stream_transform_field
        where transform_id = #{transformId,jdbcType=INTEGER}
        and is_deleted = 0
    </select>
    <select id="selectByTransformIds" resultType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        select
        <include refid="Base_Column_List"/>
        from stream_transform_field
        where transform_id in
        <foreach collection="transformIds" open="(" close=")" separator="," index="index" item="item">
            #{item}
        </foreach>
        and is_deleted = 0
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from stream_transform_field
        where id = #{id,jdbcType=INTEGER}
    </select>

    <insert id="insert" useGeneratedKeys="true" keyProperty="id"
            parameterType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        insert into stream_transform_field (id, inlong_group_id, inlong_stream_id,
                                            transform_id, transform_type, field_name,
                                            field_value, pre_expression, field_type,
                                            field_comment, is_meta_field,
                                            meta_field_name, field_format,
                                            origin_node_name, origin_field_name,
                                            rank_num, is_deleted)
        values (#{id,jdbcType=INTEGER}, #{inlongGroupId,jdbcType=VARCHAR}, #{inlongStreamId,jdbcType=VARCHAR},
                #{transformId,jdbcType=INTEGER}, #{transformType,jdbcType=VARCHAR}, #{fieldName,jdbcType=VARCHAR},
                #{fieldValue,jdbcType=VARCHAR}, #{preExpression,jdbcType=VARCHAR}, #{fieldType,jdbcType=VARCHAR},
                #{fieldComment,jdbcType=VARCHAR}, #{isMetaField,jdbcType=SMALLINT},
                #{metaFieldName,jdbcType=VARCHAR}, #{fieldFormat,jdbcType=VARCHAR},
                #{originNodeName,jdbcType=VARCHAR}, #{originFieldName,jdbcType=VARCHAR},
                #{rankNum,jdbcType=SMALLINT}, #{isDeleted,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
            parameterType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        insert into stream_transform_field
        <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="transformId != null">
                transform_id,
            </if>
            <if test="transformType != null">
                transform_type,
            </if>
            <if test="fieldName != null">
                field_name,
            </if>
            <if test="fieldValue != null">
                field_value,
            </if>
            <if test="preExpression != null">
                pre_expression,
            </if>
            <if test="fieldType != null">
                field_type,
            </if>
            <if test="fieldComment != null">
                field_comment,
            </if>
            <if test="isMetaField != null">
                is_meta_field,
            </if>
            <if test="metaFieldName != null">
                meta_field_name,
            </if>
            <if test="fieldFormat != null">
                field_format,
            </if>
            <if test="originNodeName != null">
                origin_node_name,
            </if>
            <if test="originFieldName != null">
                origin_field_name,
            </if>
            <if test="rankNum != null">
                rank_num,
            </if>
            <if test="isDeleted != null">
                is_deleted,
            </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="transformId != null">
                #{transformId,jdbcType=INTEGER},
            </if>
            <if test="transformType != null">
                #{transformType,jdbcType=VARCHAR},
            </if>
            <if test="fieldName != null">
                #{fieldName,jdbcType=VARCHAR},
            </if>
            <if test="fieldValue != null">
                #{fieldValue,jdbcType=VARCHAR},
            </if>
            <if test="preExpression != null">
                #{preExpression,jdbcType=VARCHAR},
            </if>
            <if test="fieldType != null">
                #{fieldType,jdbcType=VARCHAR},
            </if>
            <if test="fieldComment != null">
                #{fieldComment,jdbcType=VARCHAR},
            </if>
            <if test="isMetaField != null">
                #{isMetaField,jdbcType=SMALLINT},
            </if>
            <if test="metaFieldName != null">
                #{metaFieldName,jdbcType=VARCHAR},
            </if>
            <if test="fieldFormat != null">
                #{fieldFormat,jdbcType=VARCHAR},
            </if>
            <if test="originNodeName != null">
                #{originNodeName,jdbcType=VARCHAR},
            </if>
            <if test="originFieldName != null">
                #{originFieldName,jdbcType=VARCHAR},
            </if>
            <if test="rankNum != null">
                #{rankNum,jdbcType=SMALLINT},
            </if>
            <if test="isDeleted != null">
                #{isDeleted,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective"
            parameterType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        update stream_transform_field
        <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="transformId != null">
                transform_id = #{transformId,jdbcType=INTEGER},
            </if>
            <if test="transformType != null">
                transform_type = #{transformType,jdbcType=VARCHAR},
            </if>
            <if test="fieldName != null">
                field_name = #{fieldName,jdbcType=VARCHAR},
            </if>
            <if test="fieldValue != null">
                field_value = #{fieldValue,jdbcType=VARCHAR},
            </if>
            <if test="preExpression != null">
                pre_expression = #{preExpression,jdbcType=VARCHAR},
            </if>
            <if test="fieldType != null">
                field_type = #{fieldType,jdbcType=VARCHAR},
            </if>
            <if test="fieldComment != null">
                field_comment = #{fieldComment,jdbcType=VARCHAR},
            </if>
            <if test="isMetaField != null">
                is_meta_field = #{isMetaField,jdbcType=SMALLINT},
            </if>
            <if test="metaFieldName != null">
                meta_field_name = #{metaFieldName,jdbcType=VARCHAR},
            </if>
            <if test="fieldFormat != null">
                field_format = #{fieldFormat,jdbcType=VARCHAR},
            </if>
            <if test="originNodeName != null">
                origin_node_name = #{originNodeName,jdbcType=VARCHAR},
            </if>
            <if test="originFieldName != null">
                origin_field_name = #{originFieldName,jdbcType=VARCHAR},
            </if>
            <if test="rankNum != null">
                rank_num = #{rankNum,jdbcType=SMALLINT},
            </if>
            <if test="isDeleted != null">
                is_deleted = #{isDeleted,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        update stream_transform_field
        set inlong_group_id   = #{inlongGroupId,jdbcType=VARCHAR},
            inlong_stream_id  = #{inlongStreamId,jdbcType=VARCHAR},
            transform_id      = #{transformId,jdbcType=INTEGER},
            transform_type    = #{transformType,jdbcType=VARCHAR},
            field_name        = #{fieldName,jdbcType=VARCHAR},
            field_value       = #{fieldValue,jdbcType=VARCHAR},
            pre_expression    = #{preExpression,jdbcType=VARCHAR},
            field_type        = #{fieldType,jdbcType=VARCHAR},
            field_comment     = #{fieldComment,jdbcType=VARCHAR},
            is_meta_field     = #{isMetaField,jdbcType=SMALLINT},
            meta_field_name   = #{metaFieldName,jdbcType=VARCHAR},
            field_format      = #{fieldFormat,jdbcType=VARCHAR},
            origin_node_name  = #{originNodeName,jdbcType=VARCHAR},
            origin_field_name = #{originFieldName,jdbcType=VARCHAR},
            rank_num          = #{rankNum,jdbcType=SMALLINT},
            is_deleted        = #{isDeleted,jdbcType=INTEGER}
        where id = #{id,jdbcType=INTEGER}
    </update>

    <insert id="insertAll" parameterType="org.apache.inlong.manager.dao.entity.StreamTransformFieldEntity">
        insert into stream_transform_field (id, inlong_group_id,
        inlong_stream_id, transform_id,
        transform_type, field_name,
        field_value, pre_expression,
        field_type, field_comment,
        is_meta_field, meta_field_name,
        field_format, origin_node_name,
        origin_field_name,
        rank_num, is_deleted)
        values
        <foreach collection="list" index="index" item="item" separator=",">
            (#{item.id,jdbcType=INTEGER}, #{item.inlongGroupId,jdbcType=VARCHAR},
            #{item.inlongStreamId,jdbcType=VARCHAR}, #{item.transformId,jdbcType=INTEGER},
            #{item.transformType,jdbcType=VARCHAR}, #{item.fieldName,jdbcType=VARCHAR},
            #{item.fieldValue,jdbcType=VARCHAR}, #{item.preExpression,jdbcType=VARCHAR},
            #{item.fieldType,jdbcType=VARCHAR}, #{item.fieldComment,jdbcType=VARCHAR},
            #{item.isMetaField,jdbcType=SMALLINT}, #{item.metaFieldName,jdbcType=VARCHAR},
            #{item.fieldFormat,jdbcType=VARCHAR}, #{item.originNodeName,jdbcType=VARCHAR},
            #{item.originFieldName,jdbcType=VARCHAR},
            #{item.rankNum,jdbcType=SMALLINT}, #{item.isDeleted,jdbcType=INTEGER})
        </foreach>
    </insert>

    <delete id="deleteById" parameterType="java.lang.Integer">
        delete
        from stream_transform_field
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <delete id="deleteAll">
        delete
        from stream_transform_field
        where transform_id = #{transformId,jdbcType=INTEGER}
    </delete>
    <delete id="deleteByInlongGroupIds">
        delete
        from stream_transform_field
        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