BpmFlowCollectMapper.xml
2.2 KB
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
<?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.BpmFlowCollectDao">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hotent.runtime.model.BpmFlowCollect">
<id column="ID_" property="id" />
<result column="DEF_KEY_" property="defKey" />
<result column="CREATOR_" property="creator" />
<result column="CREATE_TIME_" property="createTime" />
<result column="TENANT_ID_" property="tenantId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID_, DEF_KEY_, CREATOR_, CREATE_TIME_, TENANT_ID_
</sql>
<select id="selectPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
bpm_flow_collect
${ew.customSqlSegment}
</select>
<select id="selectList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
bpm_flow_collect
${ew.customSqlSegment}
</select>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
bpm_flow_collect
where
ID_ = ${id}
</select>
<select id="getUserCollect" resultType="com.hotent.bpm.persistence.model.DefaultBpmDefinition">
select def.*
from bpm_definition def
inner join bpm_flow_collect collect
on collect.DEF_KEY_ = def.DEF_KEY_
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.customSqlSegment)">
${ew.customSqlSegment}
</if>
</select>
<select id="getUserCollectDefKeys" resultType="java.lang.String">
select DEF_KEY_
from bpm_flow_collect where CREATOR_ = #{userId}
</select>
<select id="getCollectCountByUserId" resultType="java.util.Map">
select def.TYPE_ID_ as "typeId", count(col.DEF_KEY_) as "count"
from BPM_FLOW_COLLECT col
left join BPM_DEFINITION def on def.DEF_KEY_ = col.DEF_KEY_
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.customSqlSegment)">
${ew.customSqlSegment}
AND
</if>
<if test="@com.hotent.base.ognl.Ognl@isEmpty(ew.customSqlSegment)">
WHERE
</if>
def.IS_MAIN_ = 'Y' and col.CREATOR_ = #{userId}
group by def.TYPE_ID_
</select>
</mapper>