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

mappers.WorkflowProcessEntityMapper.xml Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show 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.WorkflowProcessEntityMapper">
    <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.WorkflowProcessEntity">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="display_name" jdbcType="VARCHAR" property="displayName"/>
        <result column="type" jdbcType="VARCHAR" property="type"/>
        <result column="title" jdbcType="VARCHAR" property="title"/>
        <result column="inlong_group_id" jdbcType="VARCHAR" property="inlongGroupId"/>
        <result column="applicant" jdbcType="VARCHAR" property="applicant"/>
        <result column="status" jdbcType="VARCHAR" property="status"/>
        <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
        <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
        <result column="hidden" jdbcType="TINYINT" property="hidden"/>
        <result column="form_data" jdbcType="LONGVARCHAR" property="formData"/>
        <result column="ext_params" jdbcType="LONGVARCHAR" property="extParams"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, name, display_name, type, title, inlong_group_id, applicant,
        status, start_time, end_time, hidden, form_data, ext_params
    </sql>

    <insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
            parameterType="org.apache.inlong.manager.dao.entity.WorkflowProcessEntity">
        insert into workflow_process (name, display_name,
                                      type, title, inlong_group_id,
                                      applicant, status,
                                      start_time, end_time,
                                      form_data, ext_params, hidden)
        values (#{name,jdbcType=VARCHAR}, #{displayName,jdbcType=VARCHAR},
                #{type,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{inlongGroupId,jdbcType=VARCHAR},
                #{applicant,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
                #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
                #{formData,jdbcType=LONGVARCHAR}, #{extParams,jdbcType=LONGVARCHAR}, #{hidden,jdbcType=TINYINT})
    </insert>

    <select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from workflow_process
        where id = #{id,jdbcType=INTEGER}
    </select>
    <select id="selectByCondition" parameterType="org.apache.inlong.manager.common.pojo.workflow.ProcessQuery"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from workflow_process
        <where>
            <if test="id != null">
                and id = #{id,jdbcType=INTEGER}
            </if>
            <if test="idList != null and idList.size()>0">
                and id in
                <foreach item="item" index="index" collection="idList" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="nameList != null and nameList.size() > 0">
                and name in
                <foreach item="item" index="index" collection="nameList" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="displayName != null and displayName !=''">
                and display_name = #{displayName,jdbcType=VARCHAR}
            </if>
            <if test="inlongGroupId != null and inlongGroupId !=''">
                and inlong_group_id = #{inlongGroupId,jdbcType=VARCHAR}
            </if>
            <if test="applicant != null and applicant !=''">
                and applicant = #{applicant,jdbcType=VARCHAR}
            </if>
            <if test="status != null">
                and status = #{status,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>
            <if test="hidden != null">
                and hidden = #{hidden,jdbcType=TINYINT}
            </if>
        </where>
        order by id desc
    </select>

    <select id="countByQuery" parameterType="org.apache.inlong.manager.common.pojo.workflow.ProcessCountQuery"
            resultType="org.apache.inlong.manager.common.pojo.common.CountInfo">
        select status as `key`, count(1) as value
        from workflow_process
        <where>
            <if test="name != null and name !=''">
                and name = #{name,jdbcType=VARCHAR}
            </if>
            <if test="displayName != null and displayName !=''">
                and display_name = #{displayName,jdbcType=VARCHAR}
            </if>
            <if test="applicant != null and applicant !=''">
                and applicant = #{applicant,jdbcType=VARCHAR}
            </if>
            <if test="inlongGroupId != null and inlongGroupId !=''">
                and inlong_group_id = #{inlongGroupId,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>
            <if test="hidden != null">
                and hidden = #{hidden,jdbcType=TINYINT}
            </if>
        </where>
        group by status
    </select>

    <update id="update" parameterType="org.apache.inlong.manager.dao.entity.WorkflowProcessEntity">
        update workflow_process
        set status     = #{status,jdbcType=VARCHAR},
            end_time   = #{endTime,jdbcType=TIMESTAMP},
            ext_params = #{extParams,jdbcType=LONGVARCHAR}
        where id = #{id,jdbcType=INTEGER}
    </update>
</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy