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

mappers.WorkflowEventLogEntityMapper.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.WorkflowEventLogEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.WorkflowEventLogEntity">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="process_id" jdbcType="INTEGER" property="processId"/>
        <result column="process_name" jdbcType="VARCHAR" property="processName"/>
        <result column="process_display_name" jdbcType="VARCHAR" property="processDisplayName"/>
        <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
        <result column="task_id" jdbcType="INTEGER" property="taskId"/>
        <result column="element_name" jdbcType="VARCHAR" property="elementName"/>
        <result column="element_display_name" jdbcType="VARCHAR" property="elementDisplayName"/>
        <result column="event_type" jdbcType="VARCHAR" property="eventType"/>
        <result column="event" jdbcType="VARCHAR" property="event"/>
        <result column="listener" jdbcType="VARCHAR" property="listener"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="async" jdbcType="TINYINT" property="async"/>
        <result column="ip" jdbcType="VARCHAR" property="ip"/>
        <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
        <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
        <result column="exception" jdbcType="LONGVARCHAR" property="exception"/>
        <result column="remark" jdbcType="LONGVARCHAR" property="remark"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, process_id, process_name, process_display_name, inlong_group_id, task_id,
        element_name, element_display_name, event_type, event, listener, status, async, ip,
        start_time, end_time, remark, exception
    </sql>

    <insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
            parameterType="org.apache.inlong.manager.dao.entity.WorkflowEventLogEntity">
        insert into workflow_event_log (id, process_id,
                                        process_name, process_display_name,
                                        inlong_group_id, task_id,
                                        element_name, element_display_name,
                                        event_type, event,
                                        listener, status,
                                        async, ip, start_time,
                                        end_time, remark, exception)
        values (#{id,jdbcType=INTEGER}, #{processId,jdbcType=INTEGER},
                #{processName,jdbcType=VARCHAR}, #{processDisplayName,jdbcType=VARCHAR},
                #{inlongGroupId,jdbcType=VARCHAR}, #{taskId,jdbcType=INTEGER},
                #{elementName,jdbcType=INTEGER}, #{elementDisplayName,jdbcType=VARCHAR},
                #{eventType,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
                #{listener,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
                #{async,jdbcType=INTEGER}, #{ip,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
                #{endTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=LONGVARCHAR}, #{exception,jdbcType=LONGVARCHAR})
    </insert>

    <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from workflow_event_log
        where id = #{id,jdbcType=INTEGER}
    </select>

    <select id="selectByCondition" parameterType="org.apache.inlong.manager.pojo.workflow.EventLogRequest"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from workflow_event_log
        <where>
            <if test="id != null">
                and id = #{id,jdbcType=INTEGER}
            </if>
            <if test="processId != null">
                and process_id = #{processId,jdbcType=INTEGER}
            </if>
            <if test="processName != null and processName !=''">
                and process_name = #{processName,jdbcType=VARCHAR}
            </if>
            <if test="inlongGroupId != null">
                and inlong_group_id = #{inlongGroupId,jdbcType=INTEGER}
            </if>
            <if test="taskId != null">
                and task_id = #{taskId,jdbcType=INTEGER}
            </if>
            <if test="elementName != null and elementName !=''">
                and element_name = #{elementName,jdbcType=VARCHAR}
            </if>
            <if test="eventType != null and eventType !=''">
                and event_type = #{eventType,jdbcType=VARCHAR}
            </if>
            <if test="event != null and event !=''">
                and event = #{event,jdbcType=VARCHAR}
            </if>
            <if test="listener != null  and listener !=''">
                and listener = #{listener,jdbcType=VARCHAR}
            </if>
            <if test="status != null">
                and status = #{status,jdbcType=INTEGER}
            </if>
            <if test="ip != null and ip !=''">
                and ip = #{ip,jdbcType=VARCHAR}
            </if>
            <if test="startTimeBegin != null">
                and start_time >= #{startTimeBegin,jdbcType=TIMESTAMP}
            </if>
            <if test="startTimeEnd != null">
                and start_time &lt;= #{startTimeEnd,jdbcType=TIMESTAMP}
            </if>
            <if test="endTimeBegin != null">
                and end_time >= #{endTimeBegin,jdbcType=TIMESTAMP}
            </if>
            <if test="endTimeEnd != null">
                and end_time &lt;= #{endTimeEnd,jdbcType=TIMESTAMP}
            </if>
        </where>
        order by id desc
    </select>

    <update id="update" parameterType="org.apache.inlong.manager.dao.entity.WorkflowEventLogEntity">
        update workflow_event_log
        set status    = #{status,jdbcType=INTEGER},
            end_time  = #{endTime,jdbcType=TIMESTAMP},
            exception = #{exception,jdbcType=LONGVARCHAR},
            remark    = #{remark,jdbcType=LONGVARCHAR}
        where id = #{id,jdbcType=INTEGER}
    </update>

    <delete id="deleteByProcessIds">
        delete
        from workflow_event_log
        where process_id in
        <foreach item="item" index="index" collection="processIdList" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </delete>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy