<?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.jeeplus.flowable.mapper.FlowMapper">

	<update id="updateProcInsIdByBusinessId">
		UPDATE ${businessTable} SET
			proc_ins_id = #{procInsId}
		<if test="procDefId != null and procDefId != ''">
			,process_definition_id = #{procDefId}
		</if>
		WHERE id = #{businessId}
	</update>

	<select id="getActHiIdentitylinkList" resultType="com.jeeplus.flowable.model.ActHiIdentitylink">
		select
		  ID_ as "id",
		  REV_ as "rev",
		  GROUP_ID_ as "groupId",
		  TYPE_ as "type",
		  USER_ID_ as "userId",
		  TASK_ID_ as "taskId",
		  PROC_INST_ID_ as "procInstId",
		  PROC_DEF_ID_ as "procDefId",
		  SCOPE_ID_ as "scopeId",
		  SCOPE_TYPE_ as "scopeType",
		  SCOPE_DEFINITION_ID_ as "scopeDefinitionId"
		from
		  act_ru_identitylink
		where PROC_INST_ID_= #{processInstanceId}
	</select>

</mapper>
