懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="cn.stylefeng.guns.workflow.modular.mapper.TaskWaitingMapper">
4
5     <!-- 通用查询映射结果 -->
6     <resultMap id="BaseResultMap" type="cn.stylefeng.guns.workflow.modular.entity.Task">
7         <id column="ID_" property="id" />
8         <result column="REV_" property="rev" />
9         <result column="EXECUTION_ID_" property="executionId" />
10         <result column="PROC_INST_ID_" property="procInstId" />
11         <result column="PROC_DEF_ID_" property="procDefId" />
12         <result column="NAME_" property="name" />
13         <result column="PARENT_TASK_ID_" property="parentTaskId" />
14         <result column="DESCRIPTION_" property="description" />
15         <result column="TASK_DEF_KEY_" property="taskDefKey" />
16         <result column="OWNER_" property="owner" />
17         <result column="ASSIGNEE_" property="assignee" />
18         <result column="DELEGATION_" property="delegation" />
19         <result column="PRIORITY_" property="priority" />
20         <result column="CREATE_TIME_" property="createTime" />
21         <result column="DUE_DATE_" property="dueDate" />
22         <result column="CATEGORY_" property="category" />
23         <result column="SUSPENSION_STATE_" property="suspensionState" />
24         <result column="TENANT_ID_" property="tenantId" />
25         <result column="FORM_KEY_" property="formKey" />
26         <result column="CLAIM_TIME_" property="claimTime" />
27     </resultMap>
28
29     <!-- 通用查询结果列 -->
30     <sql id="Base_Column_List">
31         ID_ AS "id", REV_ AS "rev", EXECUTION_ID_ AS "executionId", PROC_INST_ID_ AS "procInstId", PROC_DEF_ID_ AS "procDefId", NAME_ AS "name", PARENT_TASK_ID_ AS "parentTaskId", DESCRIPTION_ AS "description", TASK_DEF_KEY_ AS "taskDefKey", OWNER_ AS "owner", ASSIGNEE_ AS "assignee", DELEGATION_ AS "delegation", PRIORITY_ AS "priority", CREATE_TIME_ AS "createTime", DUE_DATE_ AS "dueDate", CATEGORY_ AS "category", SUSPENSION_STATE_ AS "suspensionState", TENANT_ID_ AS "tenantId", FORM_KEY_ AS "formKey", CLAIM_TIME_ AS "claimTime"
32     </sql>
33
34
35     <select id="customList" resultType="cn.stylefeng.guns.workflow.modular.model.result.TaskResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.TaskParam">
36         select
37         <include refid="Base_Column_List"/>
38         from act_ru_task where 1 = 1
39             <if test="paramCondition.createTime != null and paramCondition.createTime != ''">
40                 and CREATE_TIME_ like CONCAT('%',#{paramCondition.createTime},'%')
41             </if>
42     </select>
43
44     <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.TaskParam">
45         select
46         <include refid="Base_Column_List"/>
47         from act_ru_task where 1 = 1
48             <if test="paramCondition.createTime != null and paramCondition.createTime != ''">
49                 and CREATE_TIME_ like CONCAT('%',#{paramCondition.createTime},'%')
50             </if>
51     </select>
52
53     <select id="customPageList" resultType="cn.stylefeng.guns.workflow.modular.model.result.TaskResult" parameterType="cn.stylefeng.guns.workflow.modular.model.params.TaskParam">
54         select
55         <include refid="Base_Column_List"/>
56         from act_ru_task where 1 = 1
57             <if test="paramCondition.createTime != null and paramCondition.createTime != ''">
58                 and CREATE_TIME_ like CONCAT('%',#{paramCondition.createTime},'%')
59             </if>
60     </select>
61
62     <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.workflow.modular.model.params.TaskParam">
63         select
64         <include refid="Base_Column_List"/>
65         from act_ru_task where 1 = 1
66             <if test="paramCondition.createTime != null and paramCondition.createTime != ''">
67                 and CREATE_TIME_ like CONCAT('%',#{paramCondition.createTime},'%')
68             </if>
69     </select>
70
71     <!--ACT_RU_TASK-->
72     <sql id="f">
73       f.ID_ AS "id_",
74       f.REV_ AS "rev_",
75       f.EXECUTION_ID_ AS "execution_id_",
76       f.PROC_INST_ID_ AS "proc_inst_id_",
77       f.PROC_DEF_ID_ AS "proc_def_id_",
78       f.NAME_ AS "name_",
79       f.PARENT_TASK_ID_ AS "parent_task_id_",
80       f.DESCRIPTION_ AS "description_",
81       f.TASK_DEF_KEY_ AS "task_def_key_",
82       f.OWNER_ AS "owner_",
83       f.ASSIGNEE_ AS "assignee_",
84       f.DELEGATION_ AS "delegation_",
85       f.PRIORITY_ AS "priority_",
86       f.CREATE_TIME_ AS "create_time_",
87       f.DUE_DATE_ AS "due_date_",
88       f.CATEGORY_ AS "category_",
89       f.SUSPENSION_STATE_ AS "suspension_state_",
90       f.TENANT_ID_ AS "tenant_id_",
91       f.FORM_KEY_ AS "form_key_",
92       f.CLAIM_TIME_ AS "claim_time_"
93     </sql>
94     <!-- 待办任务 or正在运行任务列表-->
95     <select id="datalistPage" resultType="map">
96         select
97         <include refid="f"/> ,
98         p.NAME_ pname_,
99         p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
100         from
101         ACT_RU_TASK f
102         left join
103         ACT_RE_PROCDEF p
104         on f.PROC_DEF_ID_ = p.ID_
105         where 1=1
106         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
107             and
108             (
109             p.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
110             or
111             f.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
112             or
113             f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
114             )
115         </if>
116         <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
117             and f.CREATE_TIME_ &gt;= CONCAT(#{pd.lastStart},' 00:00:00')
118         </if>
119         <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
120             and f.CREATE_TIME_ &lt;= CONCAT(#{pd.lastEnd},' 23:59:59')
121         </if>
122         <if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 当前办理人检索 -->
123             and
124             (
125             f.ASSIGNEE_ = #{pd.USERNAME}
126             or
127             f.ASSIGNEE_ in ${pd.RNUMBERS}
128             )
129         </if>
130         order by f.CREATE_TIME_ desc
131     </select>
132
133     <select id="datalistPage" resultType="map" databaseId="mssql">
134         select
135         <include refid="f"/> ,
136         p.NAME_ pname_,
137         p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
138         from
139         ACT_RU_TASK f
140         left join
141         ACT_RE_PROCDEF p
142         on f.PROC_DEF_ID_ = p.ID_
143         where 1=1
144         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
145             and
146             (
147             p.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
148             or
149             f.NAME_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
150             or
151             f.ASSIGNEE_ LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
152             )
153         </if>
154         <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
155             and f.CREATE_TIME_ &gt;= CONCAT(#{pd.lastStart},' 00:00:00')
156         </if>
157         <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
158             and f.CREATE_TIME_ &lt;= CONCAT(#{pd.lastEnd},' 23:59:59')
159         </if>
160         <if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 当前办理人检索 -->
161             and
162             (
163             f.ASSIGNEE_ = #{pd.USERNAME}
164             or
165             f.ASSIGNEE_ in ${pd.RNUMBERS}
166             )
167         </if>
168         order by f.CREATE_TIME_ desc
169     </select>
170
171     <select id="datalistPage" resultType="map" databaseId="pgsql">
172         select
173         <include refid="f"/> ,
174         p.NAME_ pname_,
175         p.DGRM_RESOURCE_NAME_ dgrm_resource_name_
176         from
177         ACT_RU_TASK f
178         left join
179         ACT_RE_PROCDEF p
180         on f.PROC_DEF_ID_ = p.ID_
181         where 1=1
182         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
183             and
184             (
185             p.NAME_ LIKE '%' || #{pd.keywords} || '%'
186             or
187             f.NAME_ LIKE '%' || #{pd.keywords} || '%'
188             or
189             f.ASSIGNEE_ LIKE '%' || #{pd.keywords} || '%'
190             )
191         </if>
192         <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
193             and f.CREATE_TIME_ &gt;= to_timestamp(#{pd.lastStart}||' 00:00:00','yyyy-mm-dd hh24:mi:ss')
194         </if>
195         <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
196             and f.CREATE_TIME_ &lt;= to_timestamp(#{pd.lastEnd}||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
197         </if>
198         <if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 当前办理人检索 -->
199             and
200             (
201             f.ASSIGNEE_ = #{pd.USERNAME}
202             or
203             f.ASSIGNEE_ in ${pd.RNUMBERS}
204             )
205         </if>
206         order by f.CREATE_TIME_ desc
207     </select>
208
209     <select id="datalistPage" resultType="map" databaseId="oracle">
210         select
211         <include refid="f"/> ,
212         p.NAME_ "pname_",
213         p.DGRM_RESOURCE_NAME_ "dgrm_resource_name_"
214         from
215         ACT_RU_TASK f
216         left join
217         ACT_RE_PROCDEF p
218         on f.PROC_DEF_ID_ = p.ID_
219         where 1=1
220         <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
221             and
222             (
223             p.NAME_ LIKE '%' || #{pd.keywords} || '%'
224             or
225             f.NAME_ LIKE '%' || #{pd.keywords} || '%'
226             or
227             f.ASSIGNEE_ LIKE '%' || #{pd.keywords} || '%'
228             )
229         </if>
230         <if test="pd.lastStart != null and pd.lastStart != ''"><!-- 开始时间检索 -->
231             and f.CREATE_TIME_ &gt;= to_date(#{pd.lastStart}||' 00:00:00','yyyy-mm-dd hh24:mi:ss')
232         </if>
233         <if test="pd.lastEnd != null and pd.lastEnd != ''"><!-- 结束时间检索 -->
234             and f.CREATE_TIME_ &lt;= to_date(#{pd.lastEnd}||' 23:59:59','yyyy-mm-dd hh24:mi:ss')
235         </if>
236         <if test="pd.USERNAME != null and pd.USERNAME != ''"><!-- 当前办理人检索 -->
237             and
238             (
239             f.ASSIGNEE_ = #{pd.USERNAME}
240             or
241             f.ASSIGNEE_ in ${pd.RNUMBERS}
242             )
243         </if>
244         order by f.CREATE_TIME_ desc
245     </select>
246
247     <select id="getUserRoleString" resultType="string">
248         select u.role_id as id from sys_user u WHERE u.account = #{account};
249     </select>
250
251     <select id="getUserRoleString" resultType="string" databaseId="mssql">
252         select u.role_id as id from sys_user u WHERE u.account = #{account}
253     </select>
254
255     <select id="getUserRoleString" resultType="string" databaseId="pgsql">
256         select u.role_id as "id" from sys_user u WHERE u.account = #{account}
257     </select>
258
259     <select id="getUserRoleString" resultType="string" databaseId="oracle">
260         select u.role_id as "id" from sys_user u WHERE u.account = #{account}
261     </select>
262
263 </mapper>