Blame view

backend/bpm/src/main/resources/mapper/BpmInstFormMapper.xml 2.69 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?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.BpmInstFormDao">
	<resultMap id="BpmInstForm" type="com.hotent.bpm.persistence.model.BpmInstForm">
		<id property="id" column="id_" jdbcType="VARCHAR"/>
		<result property="defId" column="def_id_" jdbcType="VARCHAR"/>
		<result property="instId" column="inst_id_" jdbcType="VARCHAR"/>
		<result property="formValue" column="form_value_" jdbcType="VARCHAR"/>
		<result property="nodeId" column="node_id_" jdbcType="VARCHAR"/>
		<result property="formType" column="form_type_" jdbcType="VARCHAR"/>
		<result property="formCategory" column="form_category_" jdbcType="VARCHAR"/>
	</resultMap>
	
	<select id="getNodeForm" parameterType="java.util.Map" resultMap="BpmInstForm">
		SELECT * FROM bpm_inst_form 
		<where>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(instId)">
				inst_id_ = #{instId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(defId)">
				and def_id_ = #{defId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(nodeId)">
				and node_id_ = #{nodeId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(formType)">
				and  form_type_ = #{formType} or form_type_ is null
			</if>
		</where>
		
	</select>
	
	<select id="getGlobalForm" parameterType="java.util.Map" resultMap="BpmInstForm">
		SELECT * FROM bpm_inst_form 
		<where>
				node_id_ is null
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(instId)">
				and inst_id_ = #{instId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(formType)">
				and form_type_ = #{formType}
			</if>
		</where>
	</select>
	
	<select id="getInstForm" parameterType="java.util.Map" resultMap="BpmInstForm">
		SELECT * FROM bpm_inst_form 
		<where>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(instId)">
				inst_id_ = #{instId} and node_id_ = #{instId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(formType)">
				and form_type_ = #{formType}
			</if>
		</where>
	</select>
	
	<select id="getSubInstanFrom" parameterType="java.util.Map" resultMap="BpmInstForm">
		SELECT * FROM bpm_inst_form 
		<where>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(instId)">
				inst_id_ = #{instId}
			</if>
			<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(formType)">
				and form_type_ = #{formType}
			</if>
			and node_id_ is null
		</where>
	</select>
	
	<delete id="removeDataByDefId" parameterType="java.lang.String">
		DELETE FROM bpm_inst_form 
		WHERE
		def_id_=#{defId}
	</delete>
	
	<delete id="removeDataByInstId" parameterType="java.lang.String">
		DELETE FROM bpm_inst_form 
		WHERE
		inst_id_=#{instId}
	</delete>
	
	
</mapper>