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

mappers.DataSourceCmdConfigEntityMapper.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.DataSourceCmdConfigEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.DataSourceCmdConfigEntity">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="cmd_type" jdbcType="INTEGER" property="cmdType"/>
        <result column="task_id" jdbcType="INTEGER" property="taskId"/>
        <result column="specified_data_time" jdbcType="VARCHAR" property="specifiedDataTime"/>
        <result column="bSend" jdbcType="BIT" property="bsend"/>
        <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="result_info" jdbcType="VARCHAR" property="resultInfo"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, cmd_type, task_id, specified_data_time, bSend, modify_time, create_time, result_info
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from stream_source_cmd_config
        where id = #{id,jdbcType=INTEGER}
    </select>
    <select id="queryCmdByAgentIp" resultMap="BaseResultMap">
        select cmd.*
        from stream_source_cmd_config cmd,
             stream_source src
        where cmd.task_id = src.id
          and cmd.cmd_type in (2, 6, 7, 8)
          and cmd.bSend = 0
          and src.agent_ip = #{ip, jdbcType=VARCHAR}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
        delete
        from stream_source_cmd_config
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.DataSourceCmdConfigEntity">
        insert into stream_source_cmd_config (id, cmd_type, task_id,
                                              specified_data_time, bSend, modify_time,
                                              create_time, result_info)
        values (#{id,jdbcType=INTEGER}, #{cmdType,jdbcType=INTEGER}, #{taskId,jdbcType=INTEGER},
                #{specifiedDataTime,jdbcType=VARCHAR}, #{bsend,jdbcType=BIT}, #{modifyTime,jdbcType=TIMESTAMP},
                #{createTime,jdbcType=TIMESTAMP}, #{resultInfo,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.DataSourceCmdConfigEntity">
        insert into stream_source_cmd_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="cmdType != null">
                cmd_type,
            </if>
            <if test="taskId != null">
                task_id,
            </if>
            <if test="specifiedDataTime != null">
                specified_data_time,
            </if>
            <if test="bsend != null">
                bSend,
            </if>
            <if test="modifyTime != null">
                modify_time,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="resultInfo != null">
                result_info,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="cmdType != null">
                #{cmdType,jdbcType=INTEGER},
            </if>
            <if test="taskId != null">
                #{taskId,jdbcType=INTEGER},
            </if>
            <if test="specifiedDataTime != null">
                #{specifiedDataTime,jdbcType=VARCHAR},
            </if>
            <if test="bsend != null">
                #{bsend,jdbcType=BIT},
            </if>
            <if test="modifyTime != null">
                #{modifyTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="resultInfo != null">
                #{resultInfo,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective"
            parameterType="org.apache.inlong.manager.dao.entity.DataSourceCmdConfigEntity">
        update stream_source_cmd_config
        <set>
            <if test="cmdType != null">
                cmd_type = #{cmdType,jdbcType=INTEGER},
            </if>
            <if test="taskId != null">
                task_id = #{taskId,jdbcType=INTEGER},
            </if>
            <if test="specifiedDataTime != null">
                specified_data_time = #{specifiedDataTime,jdbcType=VARCHAR},
            </if>
            <if test="bsend != null">
                bSend = #{bsend,jdbcType=BIT},
            </if>
            <if test="modifyTime != null">
                modify_time = #{modifyTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="resultInfo != null">
                result_info = #{resultInfo,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.DataSourceCmdConfigEntity">
        update stream_source_cmd_config
        set cmd_type            = #{cmdType,jdbcType=INTEGER},
            task_id             = #{taskId,jdbcType=INTEGER},
            specified_data_time = #{specifiedDataTime,jdbcType=VARCHAR},
            bSend               = #{bsend,jdbcType=BIT},
            modify_time         = #{modifyTime,jdbcType=TIMESTAMP},
            create_time         = #{createTime,jdbcType=TIMESTAMP},
            result_info         = #{resultInfo,jdbcType=VARCHAR}
        where id = #{id,jdbcType=INTEGER}
    </update>

</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy