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

mapper.process.xml Maven / Gradle / Ivy

There is a newer version: 2.5.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="Process">
    <insert id="SAVE" parameterType="process">
    	insert into wf_process (id,name,display_Name,type,instance_Url,state,content,version,create_Time,creator) 
    	values (#{id, jdbcType=VARCHAR},#{name, jdbcType=VARCHAR},#{displayName, jdbcType=VARCHAR},
    	#{type, jdbcType=NUMERIC},#{instanceUrl, jdbcType=VARCHAR},#{state, jdbcType=NUMERIC},
    	#{bytes, jdbcType=BLOB},#{version, jdbcType=NUMERIC},#{createTime, jdbcType=VARCHAR},#{creator, jdbcType=VARCHAR})
    </insert>
    <update id="UPDATE" parameterType="process">
    	update wf_process set 
    	name=#{name, jdbcType=VARCHAR}, 
    	display_Name=#{displayName, jdbcType=VARCHAR},
    	state=#{state, jdbcType=NUMERIC},
    	instance_Url=#{instanceUrl, jdbcType=VARCHAR},
    	content=#{bytes, jdbcType=BLOB},
       	create_Time=#{createTime, jdbcType=VARCHAR}, 
    	creator=#{creator, jdbcType=VARCHAR}
    	where id=#{id, jdbcType=VARCHAR}
    </update>
    <select id="SELECTONE" parameterType="string" resultType="process">
    	select 
    		id,
    		name,
    		display_Name as displayName,
    		type,
    		instance_Url as instanceUrl,
    		state,
    		content as bytes,
    		version,
    		create_Time as createTime,
    		creator
    	from wf_process 
    	where id = #{id, jdbcType=VARCHAR}
    </select>
    <select id="SELECTVERSION" parameterType="string" resultType="integer">
    	select 
    		max(version)
    	from wf_process 
    	where name = #{name, jdbcType=VARCHAR}
    </select>
    <select id="SELECTLIST" resultType="process">
    	select 
    		id,
    		name,
    		display_Name as displayName,
    		type,
    		instance_Url as instanceUrl,
    		state,
    		content as bytes,
    		version,
    		create_Time as createTime,
    		creator
    	from wf_process 
    </select>
    
    <select id="getProcesss" resultType="process" parameterType="hashmap">
    ${limitBefore}
    	select 
    		id,
    		name,
    		display_Name as displayName,
    		type,
    		instance_Url as instanceUrl,
    		state,
    		content as bytes,
    		version,
    		create_Time as createTime,
    		creator
    	<include refid="selectProcesss"/>
	${orderby}
	${limitAfter}
    </select>
    
    <select id="getProcesssCount" resultType="long" parameterType="hashmap">
   		select count(id)
    	<include refid="selectProcesss"/>
    </select>
    
    <sql id="selectProcesss">
		from wf_process
		<where>
	        <if test="names != null and names.length > 0">
		        and name in
				<foreach collection="names" index="index" item="item" open="(" separator="," close=")">
					#{item, jdbcType=VARCHAR}
				</foreach>
			</if>
      		<if test="displayName != null">
        		and display_Name like "%#{displayName, jdbcType=VARCHAR}%"
      		</if>
      		<if test="state != null">
        		and state = #{state, jdbcType=NUMERIC}
      		</if>
      		<if test="version != null">
        		and version = #{version, jdbcType=NUMERIC}
      		</if>
      	</where>
    </sql>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy