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

META-INF.modeler-mybatis-mappings.ModelHistory.xml Maven / Gradle / Ivy

There is a newer version: 6.8.1
Show newest version
<?xml version="1.0" encoding="UTF-8" ?> 

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.flowable.ui.modeler.domain.ModelHistory">

    <resultMap id="modelHistoryResultMap" type="org.flowable.ui.modeler.domain.ModelHistory">
        <id property="id" column="id" jdbcType="VARCHAR" />
        <result property="name" column="name" jdbcType="VARCHAR" />
        <result property="key" column="model_key" jdbcType="VARCHAR" />
        <result property="description" column="description" jdbcType="VARCHAR" />
        <result property="comment" column="model_comment" jdbcType="VARCHAR" />
        <result property="created" column="created" jdbcType="TIMESTAMP" />
        <result property="createdBy" column="created_by" jdbcType="VARCHAR" />
        <result property="lastUpdated" column="last_updated" jdbcType="TIMESTAMP" />
        <result property="lastUpdatedBy" column="last_updated_by" jdbcType="VARCHAR" />
        <result property="version" column="version" jdbcType="INTEGER" />
        <result property="modelEditorJson" column="model_editor_json" jdbcType="VARCHAR" />
        <result property="modelType" column="model_type" jdbcType="INTEGER" />
        <result property="modelId" column="model_id" jdbcType="VARCHAR" />
        <result property="removalDate" column="removal_date" jdbcType="TIMESTAMP" />
        <result property="tenantId" column="tenant_id" jdbcType="VARCHAR" />
    </resultMap>

    <insert id="insertModelHistory" parameterType="org.flowable.ui.modeler.domain.ModelHistory">
        insert into ${prefix}ACT_DE_MODEL_HISTORY (
            id,
            name,
            model_key,
            description,
            model_comment,
            created,
            created_by,
            last_updated,
            last_updated_by,
            version,
            model_editor_json,
            model_type,
            model_id,
            removal_date,
            tenant_id) 
         values (
             #{id, jdbcType=VARCHAR},
            #{name, jdbcType=VARCHAR},
            #{key, jdbcType=VARCHAR},
            #{description, jdbcType=VARCHAR},
            #{comment, jdbcType=VARCHAR},
            #{created, jdbcType=TIMESTAMP},
            #{createdBy, jdbcType=VARCHAR},
            #{lastUpdated, jdbcType=TIMESTAMP},
            #{lastUpdatedBy, jdbcType=VARCHAR},
            #{version, jdbcType=INTEGER},
            #{modelEditorJson, jdbcType=VARCHAR},
            #{modelType, jdbcType=INTEGER},
            #{modelId, jdbcType=VARCHAR},
            #{removalDate, jdbcType=TIMESTAMP},
            #{tenantId, jdbcType=VARCHAR}
          )
    </insert>
    
    <update id="updateModelHistory" parameterType="org.flowable.ui.modeler.domain.Model">
        update ${prefix}ACT_DE_MODEL_HISTORY
        <set>
            name = #{name, jdbcType=VARCHAR},
            model_key = #{key, jdbcType=VARCHAR},
            description = #{description, jdbcType=VARCHAR},
            model_comment = #{comment, jdbcType=VARCHAR},
            created = #{created, jdbcType=TIMESTAMP},
            created_by = #{createdBy, jdbcType=VARCHAR},
            last_updated = #{lastUpdated, jdbcType=TIMESTAMP},
            last_updated_by = #{lastUpdatedBy, jdbcType=VARCHAR},
            version = #{version, jdbcType=INTEGER},
            model_editor_json = #{modelEditorJson, jdbcType=VARCHAR},
            model_id = #{modelId, jdbcType=VARCHAR},
            removal_date = #{removalDate, jdbcType=TIMESTAMP},
            tenant_id = #{tenantId, jdbcType=VARCHAR}
        </set>
        where id = #{id, jdbcType=VARCHAR}
    </update>

    <select id="selectModelHistory" parameterType="string" resultMap="modelHistoryResultMap">
        select * from ${prefix}ACT_DE_MODEL_HISTORY where id = #{id, jdbcType=VARCHAR}
    </select>
    
    <select id="selectModelHistoryByTypeAndCreatedBy" parameterType="map" resultMap="modelHistoryResultMap">
       select * from ${prefix}ACT_DE_MODEL_HISTORY 
       where created_by = #{createdBy, jdbcType=VARCHAR}
       and model_type = #{modelType, jdbcType=INTEGER}
       and removal_date is null
      <if test="tenantId != null">
       and tenant_id = #{tenantId, jdbcType=VARCHAR}
      </if>
    </select>
    
    <select id="selectModelHistoryByModelId" parameterType="string" resultMap="modelHistoryResultMap">
       select * from ${prefix}ACT_DE_MODEL_HISTORY 
       where model_id = #{modelId, jdbcType=VARCHAR}
       and removal_date is null
    </select>
    
    <delete id="deleteModelHistory" parameterType="org.flowable.ui.modeler.domain.ModelHistory">
        delete from ${prefix}ACT_DE_MODEL_HISTORY where id = #{id, jdbcType=VARCHAR}
    </delete>
    
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy