BpmPrintRecordMapper.xml 1.97 KB
<?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.hotent.runtime.dao.BpmPrintRecordDao">
	<resultMap id="BpmPrintRecord" type="com.hotent.runtime.model.BpmPrintRecord">
		<id property="id" column="ID_" jdbcType="VARCHAR"/>
		<result property="procDefKey" column="PROC_DEF_KEY_" jdbcType="VARCHAR"/>
		<result property="procDefName" column="PROC_DEF_NAME_" jdbcType="VARCHAR"/>
		<result property="procDefId" column="PROC_DEF_ID_" jdbcType="VARCHAR"/>
		<result property="procInstId" column="PROC_INST_ID_" jdbcType="VARCHAR"/>
		<result property="nodeId" column="NODE_ID_" jdbcType="VARCHAR"/>
		<result property="formKey" column="FORM_KEY_" jdbcType="VARCHAR"/>
		<result property="templateId" column="TEMPLATE_ID_" jdbcType="VARCHAR"/>
		<result property="templateName" column="TEMPLATE_NAME_" jdbcType="VARCHAR"/>
		<result property="fileId" column="FILE_ID_" jdbcType="VARCHAR"/>
		<result property="lastVersion" column="LAST_VERSION_" jdbcType="NUMERIC"/>
		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
		<result property="createOrgId" column="CREATE_ORG_ID_" jdbcType="VARCHAR"/>
		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
	</resultMap>
	
	<select id="getLastVersion" parameterType="java.lang.String" resultMap="BpmPrintRecord">
		SELECT a.* FROM BPM_PRINT_RECORD a WHERE a.LAST_VERSION_=1
		a.PROC_INST_ID_=#{procInstId} and a.NODE_ID_=#{nodeId} and a.TEMPLATE_ID_=#{templateId}
	</select>
	
	<update id="cleanLastVersion" parameterType="java.lang.String"> 
		UPDATE BPM_PRINT_RECORD SET LAST_VERSION_=0 where PROC_INST_ID_=#{procInstId} and NODE_ID_=#{nodeId} and TEMPLATE_ID_=#{templateId}
	</update>
</mapper>