Blame view

backend/bpm/src/main/resources/mapper/BpmProStatusMapper.xml 2.78 KB
8d73e917   陈威   初始化提交
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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.bpm.persistence.dao.BpmProStatusDao">
	<resultMap id="DefaultBpmProStatus" type="com.hotent.bpm.persistence.model.DefaultBpmProStatus">
		<id property="id" column="id_" jdbcType="VARCHAR"/>
		<result property="procInstId" column="proc_inst_id_" jdbcType="VARCHAR"/>
		<result property="procDefId" column="proc_def_id_" jdbcType="VARCHAR"/>
		<result property="nodeId" column="node_id_" jdbcType="VARCHAR"/>
		<result property="nodeName" column="node_name_" jdbcType="VARCHAR"/>
		<result property="status" column="status_" jdbcType="VARCHAR"/>
		<result property="lastUpdate" column="last_update_" jdbcType="TIMESTAMP"/>
		<result property="lastUserid" column="last_userid_" jdbcType="VARCHAR"/>
		<result property="recycleNode" column="recycle_node_" jdbcType="VARCHAR"/>
	</resultMap>
	
	<select id="queryHistorys"   parameterType="java.lang.String" resultMap="DefaultBpmProStatus">
		SELECT * FROM bpm_pro_status_hi 
		WHERE 
		proc_inst_id_=#{procInstId}
	</select>	
	
	
	<insert id="archiveHistory"  parameterType="java.lang.String" >
		insert into bpm_pro_status_hi (id_,proc_inst_id_,proc_def_id_,node_id_,node_name_,status_,last_update_,last_userid_) 
		select id_,proc_inst_id_,proc_def_id_,node_id_,node_name_,status_,last_update_,last_userid_  from bpm_pro_status where proc_inst_id_=#{procInstId}
	</insert>
	
	<select id="getByInstNodeId"  parameterType="java.util.Map"  resultMap="DefaultBpmProStatus">
		select * from  bpm_pro_status  where proc_inst_id_=#{procInstId} and node_id_= #{nodeId}
	</select>
	
	
	<delete id="delByInstList" >
		DELETE FROM  bpm_pro_status where proc_inst_id_ in 
			<foreach collection="list" index="index" item="instId" open="(" separator="," close=")"> 
            #{instId} 
        	</foreach> 
	</delete>
	
	<update id="updStatusByInstList" >
		update bpm_pro_status set status_=#{status} where proc_inst_id_ in 
			<foreach collection="list" index="index" item="instId" open="(" separator="," close=")"> 
            #{instId} 
        	</foreach> 
        	and status_='pending'
	</update>

	<update id="updStatusByInstIdAndNodeId">
		update bpm_pro_status set status_=#{status} where proc_inst_id_=#{instId} and node_id_= #{nodeId}
	</update>

	<update id="updateRecycleNode">
		update bpm_pro_status set recycle_node_=#{recycleNode} where proc_inst_id_=#{instId} and node_id_ in
		<foreach collection="nodeIds" item="nodeId" open="(" separator="," close=")">
			#{nodeId}
		</foreach>
	</update>
	<select id="getByInstIdAndRecycleNode" resultType="string">
		select node_id_ from bpm_pro_status where proc_inst_id_=#{instId} and  recycle_node_=#{recycleNode} ORDER BY LAST_UPDATE_ desc,id_ desc
	</select>
</mapper>