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

org.flowable.content.db.mapping.entity.ContentItem.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.content.engine.impl.persistence.entity.ContentItemEntityImpl">

	<resultMap id="contentItemResultMap" type="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl">
		<id property="id" column="ID_" jdbcType="VARCHAR" />
		<result property="name" column="NAME_" jdbcType="VARCHAR" />
		<result property="mimeType" column="MIME_TYPE_" jdbcType="VARCHAR" />
		<result property="taskId" column="TASK_ID_" jdbcType="VARCHAR" />
		<result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
		<result property="contentStoreId" column="CONTENT_STORE_ID_" jdbcType="VARCHAR" />
		<result property="contentStoreName" column="CONTENT_STORE_NAME_" jdbcType="VARCHAR" />
		<result property="field" column="FIELD_" jdbcType="VARCHAR" />
		<result property="contentAvailable" column="CONTENT_AVAILABLE_" jdbcType="BOOLEAN" />
		<result property="contentSize" column="CONTENT_SIZE_" jdbcType="BIGINT" />
		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR" />
		<result property="created" column="CREATED_" jdbcType="TIMESTAMP" />
		<result property="createdBy" column="CREATED_BY_" jdbcType="VARCHAR" />
		<result property="lastModified" column="LAST_MODIFIED_" jdbcType="VARCHAR" />
		<result property="lastModifiedBy" column="LAST_MODIFIED_BY_" jdbcType="VARCHAR" />
	</resultMap>
	
	
    <insert id="insertContentItem" parameterType="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl">
        insert into ${prefix}ACT_CO_CONTENT_ITEM (
            ID_,
            NAME_,
            MIME_TYPE_,
            TASK_ID_,
            PROC_INST_ID_,
            CONTENT_STORE_ID_,
            CONTENT_STORE_NAME_,
            FIELD_,
            CONTENT_AVAILABLE_,
            CONTENT_SIZE_,
            TENANT_ID_,
            CREATED_,
            CREATED_BY_,
            LAST_MODIFIED_,
            LAST_MODIFIED_BY_)
         values (
            #{id, jdbcType=VARCHAR},
            #{name, jdbcType=VARCHAR},
            #{mimeType, jdbcType=VARCHAR},
            #{taskId, jdbcType=VARCHAR},
            #{processInstanceId, jdbcType=VARCHAR},
            #{contentStoreId, jdbcType=VARCHAR},
            #{contentStoreName, jdbcType=VARCHAR},
            #{field, jdbcType=VARCHAR},
            #{contentAvailable, jdbcType=BOOLEAN},
            #{contentSize, jdbcType=BIGINT},
            #{tenantId, jdbcType=VARCHAR},
            #{created, jdbcType=TIMESTAMP},
            #{createdBy, jdbcType=VARCHAR},
            #{lastModified, jdbcType=TIMESTAMP},
            #{lastModifiedBy, jdbcType=VARCHAR}
          )
    </insert>
    
    <update id="updateContentItem" parameterType="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl">
        update ${prefix}ACT_CO_CONTENT_ITEM
        <set>
            NAME_=#{name, jdbcType=VARCHAR},
            MIME_TYPE_=#{mimeType, jdbcType=VARCHAR},
            TASK_ID_=#{taskId, jdbcType=VARCHAR},
            PROC_INST_ID_=#{processInstanceId, jdbcType=VARCHAR},
            CONTENT_STORE_ID_=#{contentStoreId, jdbcType=VARCHAR},
            CONTENT_STORE_NAME_=#{contentStoreName, jdbcType=VARCHAR},
            FIELD_=#{field, jdbcType=VARCHAR},
            CONTENT_AVAILABLE_=#{contentAvailable, jdbcType=BOOLEAN},
            CONTENT_SIZE_=#{contentSize, jdbcType=BIGINT},
            TENANT_ID_=#{tenantId, jdbcType=BIGINT},
            CREATED_=#{created, jdbcType=TIMESTAMP},
            CREATED_BY_=#{createdBy, jdbcType=TIMESTAMP},
            LAST_MODIFIED_=#{lastModified, jdbcType=TIMESTAMP},
            LAST_MODIFIED_BY_=#{lastModifiedBy, jdbcType=VARCHAR}
        </set>
        where ID_ = #{id, jdbcType=VARCHAR}
    </update>
    
    <select id="selectContentItem" parameterType="string" resultMap="contentItemResultMap">
        select * from ${prefix}ACT_CO_CONTENT_ITEM where ID_ = #{id, jdbcType=VARCHAR}
    </select>

	<select id="selectContentItemsByQueryCriteria" parameterType="org.flowable.content.engine.impl.ContentItemQueryImpl" resultMap="contentItemResultMap">
	  	<if test="firstResult != null and firstResult &gt;= 0">${limitBefore}</if>
	    select RES.* <if test="firstResult != null and firstResult &gt;= 0">${limitBetween}</if>
	    <include refid="selectContentItemsByQueryCriteriaSql"/>
	    ${orderBy}
	    <if test="firstResult != null and firstResult &gt;= 0">${limitAfter}</if>
    </select>
	
	<select id="selectContentItemCountByQueryCriteria" parameterType="org.flowable.content.engine.impl.ContentItemQueryImpl" resultType="long">
	    select count(RES.ID_)
	    <include refid="selectContentItemsByQueryCriteriaSql"/>
	</select>
	  
	<sql id="selectContentItemsByQueryCriteriaSql">  
	    from ${prefix}ACT_CO_CONTENT_ITEM RES
	    <where>
	      <if test="id != null">
	        RES.ID_ = #{id}
	      </if>
	      <if test="ids != null and ids">
	        and RES.ID_ in
	        <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
	          #{item}
	        </foreach>
	      </if>
	      <if test="name != null">
	        and RES.NAME_ = #{name}
	      </if>
	      <if test="nameLike != null">
	        and RES.NAME_ like #{nameLike}
	      </if>
	      <if test="mimeType != null">
	        and RES.MIME_TYPE_ = #{mimeType}
	      </if>
	      <if test="mimeTypeLike != null">
	        and RES.MIME_TYPE_ like #{mimeTypeLike}
	      </if>
	      <if test="taskId != null">
	        and RES.TASK_ID_ = #{taskId}
	      </if>
	      <if test="taskIdLike != null">
	        and RES.TASK_ID_ like #{taskIdLike}
	      </if>
	      <if test="processInstanceId != null">
	        and RES.PROC_INST_ID_ = #{processInstanceId}
	      </if>
	      <if test="processInstanceIdLike != null">
	        and RES.PROC_INST_ID_ like #{processInstanceIdLike}
	      </if>
	      <if test="contentStoreId != null">
	        and RES.CONTENT_STORE_ID_ = #{contentStoreId}
	      </if>
	      <if test="contentStoreIdLike != null">
	        and RES.CONTENT_STORE_ID_ like #{contentStoreIdLike}
	      </if>
	      <if test="contentStoreName != null">
	        and RES.CONTENT_STORE_NAME_ = #{contentStoreName}
	      </if>
	      <if test="contentStoreNameLike != null">
	        and RES.CONTENT_STORE_NAME_ like #{contentStoreNameLike}
	      </if>
	      <if test="field != null">
	        and RES.FIELD_ = #{field}
	      </if>
	      <if test="fieldLike != null">
	        and RES.FIELD_ like #{fieldLike}
	      </if>
	      <if test="contentAvailable != null">
	        and RES.CONTENT_AVAILABLE_ = #{contentAvailable}
	      </if>
	      <if test="contentSize != null">
            and RES.CONTENT_SIZE_ = #{contentSize}
          </if> 
          <if test="minContentSize != null">
            and RES.CONTENT_SIZE_ &gt;= #{minContentSize}
          </if> 
          <if test="maxContentSize != null">
            and RES.CONTENT_SIZE_ &lt;= #{maxContentSize}
          </if> 
	      <if test="createdDate != null">
	        and RES.CREATED_ = #{createdDate}
	      </if>
	      <if test="createdDateBefore != null">
	        and RES.CREATED_ &lt; #{createdDateBefore}
	      </if>
	      <if test="createdDateAfter != null">
	        and RES.CREATED_ &gt; #{createdDateAfter}
	      </if>
	      <if test="createdBy != null">
	        and RES.CREATED_BY_ = #{createdBy}
	      </if>
	      <if test="createdByLike != null">
	        and RES.CREATED_BY_ like #{createdByLike}
	      </if>
	      <if test="lastModifiedDate != null">
	        and RES.LAST_MODIFIED_ = #{lastModifiedDate}
	      </if>
	      <if test="lastModifiedDateBefore != null">
	        and RES.LAST_MODIFIED_ &lt; #{lastModifiedDateBefore}
	      </if>
	      <if test="lastModifiedDateAfter != null">
	        and RES.LAST_MODIFIED_ &gt; #{lastModifiedDateAfter}
	      </if>
	      <if test="lastModifiedBy != null">
	        and RES.LAST_MODIFIED_BY_ = #{lastModifiedBy}
	      </if>
	      <if test="lastModifiedByLike != null">
	        and RES.LAST_MODIFIED_BY_ like #{lastModifiedByLike}
	      </if>
	      <if test="tenantId != null">
	        and RES.TENANT_ID_ = #{tenantId}
	      </if>
	      <if test="tenantIdLike != null">
	        and RES.TENANT_ID_ like #{tenantIdLike}
	      </if>
	      <if test="withoutTenantId">
	        and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null)
	      </if>
	    </where>
	</sql>
	    
	<!-- mysql specific sql -->
	<select id="selectContentItemsByQueryCriteria" databaseId="mysql" parameterType="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl" resultMap="contentItemResultMap">
	  	<if test="firstResult != null and firstResult &gt;= 0">${limitBefore}</if>
	    select distinct RES.* <if test="firstResult != null and firstResult &gt;= 0">${limitBetween}</if>
	    <include refid="selectContentItemsByQueryCriteriaSql"/>
	    ${orderBy}
	    <if test="firstResult != null and firstResult &gt;= 0">${limitAfter}</if>
	</select>
	
	<!-- mysql specific sql -->
	<select id="selectContentItemCountByQueryCriteria" databaseId="mysql" parameterType="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl" resultType="long">
	   	select distinct count(RES.ID_)
	    <include refid="selectContentItemsByQueryCriteriaSql"/>
	</select>
	
	<delete id="deleteContentItem" parameterType="org.flowable.content.engine.impl.persistence.entity.ContentItemEntityImpl">
	   delete from ${prefix}ACT_CO_CONTENT_ITEM where ID_ = #{id, jdbcType=VARCHAR}
	</delete>
	
	<delete id="deleteContentItemsByProcessInstanceId" parameterType="string">
	   delete from ${prefix}ACT_CO_CONTENT_ITEM where PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
	</delete>
	
	<delete id="deleteContentItemsByTaskId" parameterType="string">
	   delete from ${prefix}ACT_CO_CONTENT_ITEM where TASK_ID_ = #{taskId, jdbcType=VARCHAR}
	</delete>
	
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy