ActUserProcessInstanceIdMapper.xml 3.2 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?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="com.skyeye.eve.dao.ActUserProcessInstanceIdDao">
	
	<select id="queryStartProcessNotSubByUserId" parameterType="java.util.Map" resultType="java.util.Map">
		SELECT
			a.process_instance_id processInstanceId,
			IFNULL(b.id, "") sequenceId,
			a.create_time createTime,
			a.data_id dataId,
			IF(IFNULL(c.edit_page_url, '') = '', '../../tpl/myactiviti/myactivitiedit.html', c.edit_page_url) pageUrl,
			c.title taskType,
			IF(IFNULL(c.revoke_mapping, '') = '', 'dsformrevoke001', c.revoke_mapping) revokeMapping
		FROM
			act_user_processinstanceid a
			LEFT JOIN ds_form_page_sequence b ON a.process_instance_id = b.process_instance_id 
			LEFT JOIN act_model c ON c.act_id = a.act_id
		WHERE
			a.create_id = #{createId}
			<if test="startTime != '' and startTime != null and endTime != '' and endTime != null">
				AND a.create_time >= #{startTime} AND #{endTime} >= a.create_time
			</if>
			<if test="processInstanceId != '' and processInstanceId != null">
				AND a.process_instance_id = #{processInstanceId}
			</if>
		GROUP BY a.process_instance_id
		ORDER BY a.create_time DESC
	</select>
	
	<insert id="insertActUserProInsIdMation" parameterType="java.util.Map">
	     INSERT act_user_processinstanceid
	     (id, process_instance_id, act_id, data_id, create_id, create_time)
	     VALUES
	     (#{id}, #{processInstanceId}, #{keyName}, #{dataId}, #{createId}, #{createTime})
	</insert>
	
doc_wei's avatar
doc_wei 已提交
37
	<select id="queryProcessInstanceMationByProcessInstanceId" resultType="java.util.Map">
doc_wei's avatar
doc_wei 已提交
38 39 40
		SELECT
			a.process_instance_id processInstanceId,
			a.create_time createTime,
doc_wei's avatar
doc_wei 已提交
41 42
		    IFNULL(b.title, '未知流程') title,
			CONCAT_WS('_', seus.job_number, seus.user_name) createName,
doc_wei's avatar
doc_wei 已提交
43 44 45 46
			b.page_types pageTypes
		FROM
			act_user_processinstanceid a
			LEFT JOIN act_model b ON a.act_id = b.act_id AND b.state != '4'
doc_wei's avatar
doc_wei 已提交
47
			LEFT JOIN sys_eve_user_staff seus on b.create_id = seus.user_id
doc_wei's avatar
doc_wei 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
		WHERE
			a.process_instance_id = #{processInstanceId}
		GROUP BY a.process_instance_id
	</select>
	
	<select id="queryProcessMationByProcessInstanceId" parameterType="java.util.Map" resultType="java.util.Map">
		SELECT
			a.process_instance_id processInstanceId,
			a.create_time createTime
		FROM
			act_user_processinstanceid a
		WHERE
			a.process_instance_id = #{processInstanceId}
		AND a.create_id = #{userId}
		GROUP BY a.process_instance_id
	</select>
	
	<update id="editDsFormStateIsDraftByProcessInstanceId" parameterType="java.util.Map">
		UPDATE ds_form_page_sequence
		<set>
			process_instance_id = '',
			state = '1'
		</set>
		WHERE process_instance_id = #{processInstanceId}
	</update>
	
	<delete id="deleteProcessMationByProcessInstanceId" parameterType="java.lang.String">
		DELETE 
		FROM 
			act_user_processinstanceid
		where 
			process_instance_id = #{processInstanceId}
	</delete>

	<select id="queryActUserProcessInstanceId" parameterType="java.util.Map" resultType="java.util.Map">
		SELECT
			a.create_id createId,
			b.company_id companyId
		FROM
			act_user_processinstanceid a,
			sys_eve_user_staff b
		WHERE a.process_instance_id = #{processInstanceId}
		  AND a.create_id = b.user_id
	</select>
	
</mapper>