<?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.ruili.wcp.dao.management.FlowHistoryTaskMapper">
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="mysql">
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id1,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC
|
limit #{currIndex} ,
|
#{pageSize}
|
</select>
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="oracle">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="kingbasees">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="dameng">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a
|
left join sys_flow_history_task b on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null
|
and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="xugu">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="sqlServer">
|
SELECT * FROM (
|
SELECT A.* FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name,
|
row_number() over (order by b.end_time desc) as rn
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
) A
|
) T WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
|
<select id="findHistoryTasksCountByAssigneeId" parameterType="map" resultType="int">
|
SELECT
|
count(1)
|
FROM sys_flow_history_process a
|
left join sys_flow_history_task b on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c on c.process_instance_id = a.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
WHERE b.end_time is not null
|
and b.assignee_user_id = #{userId}
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
</select>
|
|
<!--获取已办列表(个人、公办)-->
|
<select id="findDoneDealHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="mysql">
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.start_user_name,a.create_unit,a.file_code,a.last_update_time,
|
b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id and c.assignee_user_id is not null
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.is_circulate=0
|
<if test='type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id = #{userId}
|
</if>
|
<if test='type =="1"'>
|
and b.assignee_type>0 and b.CLAIM_USER_ID = #{userId}
|
</if>
|
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC,IFNULL(a.emergency_degree_code,-1) desc
|
limit #{currIndex} ,
|
#{pageSize}
|
</select>
|
<select id="findDoneDealHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="oracle">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.start_user_name,a.create_unit,a.file_code,a.last_update_time,
|
b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a
|
inner join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id and c.assignee_user_id is not null
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.is_circulate=0
|
<if test='type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id = #{userId}
|
</if>
|
<if test='type =="1"'>
|
and b.assignee_type>0 and b.CLAIM_USER_ID = #{userId}
|
</if>
|
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC,NVL(a.emergency_degree_code,-1) desc
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findDoneDealHistoryTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="kingbasees">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.start_user_name,a.create_unit,a.file_code,a.last_update_time,
|
b.*,
|
c.assignee_user_id as current_user_id,
|
c.assignee_user_name as current_user_name,
|
c.task_name as current_task_name,
|
f.module_name
|
FROM sys_flow_history_process a
|
inner join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join sys_flow_runtime_task c
|
on c.process_instance_id = a.process_instance_id and c.assignee_user_id is not null
|
left join cnf_module f on a.module_id = f.module_id
|
where b.end_time is not null and b.is_circulate=0
|
<if test='type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id = #{userId}
|
</if>
|
<if test='type =="1"'>
|
and b.assignee_type>0 and b.CLAIM_USER_ID = #{userId}
|
</if>
|
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.end_time DESC,NVL(a.emergency_degree_code,-1) desc
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
|
<!--获取已办数量(个人、公办)-->
|
<select id="findDoneDealHistoryTasksCountByAssigneeId" parameterType="map" resultType="int">
|
SELECT
|
count(1)
|
FROM sys_flow_history_process a
|
inner join sys_flow_history_task b on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
WHERE b.end_time is not null and b.is_circulate=0
|
<if test='type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id = #{userId}
|
</if>
|
<if test='type =="1"'>
|
and b.assignee_type>0 and b.CLAIM_USER_ID = #{userId}
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
</select>
|
|
<!--获取我的拟稿数量(0:已拟稿、1:进行中、2:已结束)-->
|
<select id="findMyDraftTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="mysql">
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,a.start_user_name,a.process_instance_id,a.last_update_time,
|
f.module_name,
|
<if test='type =="0"'>
|
b.task_name
|
</if>
|
<if test='type =="1"'>
|
b.activity_name as task_name
|
</if>
|
<if test='type =="2"'>
|
'已结束' as task_name
|
</if>
|
FROM sys_flow_history_process a
|
<if test='type =="0"'>
|
inner join sys_flow_history_task b
|
</if>
|
<if test='type =="1"'>
|
inner join SYS_FLOW_RUNTIME_EXECUTION b
|
</if>
|
<if test='type =="2"'>
|
left join sys_flow_history_task b
|
</if>
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where a.START_USER_ID=#{userId}
|
<if test='type =="0"'>
|
and a.START_ACTIVITY_ID=b.TASK_DEFINITION_ID
|
and b.END_TIME is null
|
and a.END_TIME is null
|
and b.is_circulate=0
|
and b.ASSIGNEE_USER_ID=#{userId}
|
</if>
|
<if test='type =="1"'>
|
and a.END_TIME is null
|
and b.PARENT_EXECUTION_ID!=0
|
and a.START_ACTIVITY_ID!=b.ACTIVITY_ID
|
</if>
|
<if test='type =="2"'>
|
and a.END_TIME is not null
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
<if test='type ="0"'>
|
ORDER BY a.start_time DESC
|
</if>
|
<if test='type =="1"'>
|
ORDER BY b.start_time DESC
|
</if>
|
<if test='type ="2"'>
|
ORDER BY a.end_time DESC
|
</if>
|
limit #{currIndex} ,
|
#{pageSize}
|
</select>
|
<select id="findMyDraftTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="oracle">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,a.start_user_name,a.process_instance_id,
|
f.module_name,
|
<if test='type =="0"'>
|
b.task_name
|
</if>
|
<if test='type =="1"'>
|
b.activity_name as task_name
|
</if>
|
<if test='type =="2"'>
|
'已结束' as task_name
|
</if>
|
FROM sys_flow_history_process a
|
<if test='type =="0"'>
|
inner join sys_flow_history_task b
|
</if>
|
<if test='type =="1"'>
|
-- (select top 1 activity_name from SYS_FLOW_RUNTIME_EXECUTION b where and b.PARENT_EXECUTION_ID!=0
|
-- and a.START_ACTIVITY_ID!=b.ACTIVITY_ID) as task_name
|
inner join SYS_FLOW_RUNTIME_EXECUTION b
|
</if>
|
<if test='type =="2"'>
|
left join sys_flow_history_task b
|
</if>
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where a.START_USER_ID=#{userId}
|
<if test='type =="0"'>
|
and a.START_ACTIVITY_ID=b.TASK_DEFINITION_ID
|
and b.END_TIME is null
|
and a.END_TIME is null
|
and b.is_circulate=0
|
and b.ASSIGNEE_USER_ID=#{userId}
|
</if>
|
<if test='type =="1"'>
|
and a.END_TIME is null
|
and b.PARENT_EXECUTION_ID!=0
|
and a.START_ACTIVITY_ID!=b.ACTIVITY_ID
|
</if>
|
<if test='type =="2"'>
|
and a.END_TIME is not null
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
<if test='type =="0"'>
|
ORDER BY a.start_time DESC
|
</if>
|
<if test='type =="1"'>
|
ORDER BY b.start_time DESC
|
</if>
|
<if test='type =="2"'>
|
ORDER BY a.end_time DESC
|
</if>
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findMyDraftTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="kingbasees">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,a.start_user_name,a.process_instance_id,
|
f.module_name,
|
<if test='type =="0"'>
|
b.task_name
|
</if>
|
<if test='type =="1"'>
|
b.activity_name as task_name
|
</if>
|
<if test='type =="2"'>
|
'已结束' as task_name
|
</if>
|
FROM sys_flow_history_process a
|
<if test='type =="0"'>
|
inner join sys_flow_history_task b
|
</if>
|
<if test='type =="1"'>
|
-- (select top 1 activity_name from SYS_FLOW_RUNTIME_EXECUTION b where and b.PARENT_EXECUTION_ID!=0
|
-- and a.START_ACTIVITY_ID!=b.ACTIVITY_ID) as task_name
|
inner join SYS_FLOW_RUNTIME_EXECUTION b
|
</if>
|
<if test='type =="2"'>
|
left join sys_flow_history_task b
|
</if>
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where a.START_USER_ID=#{userId}
|
<if test='type =="0"'>
|
and a.START_ACTIVITY_ID=b.TASK_DEFINITION_ID
|
and b.END_TIME is null
|
and a.END_TIME is null
|
and b.is_circulate=0
|
and b.ASSIGNEE_USER_ID=#{userId}
|
</if>
|
<if test='type =="1"'>
|
and a.END_TIME is null
|
and b.PARENT_EXECUTION_ID!=0
|
and a.START_ACTIVITY_ID!=b.ACTIVITY_ID
|
</if>
|
<if test='type =="2"'>
|
and a.END_TIME is not null
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
<if test='type =="0"'>
|
ORDER BY a.start_time DESC
|
</if>
|
<if test='type =="1"'>
|
ORDER BY b.start_time DESC
|
</if>
|
<if test='type =="2"'>
|
ORDER BY a.end_time DESC
|
</if>
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
|
<!--获取我的拟稿数量(0:已拟稿、1:进行中、2:已结束)-->
|
<select id="findMyDraftTasksCountByAssigneeId" parameterType="map" resultType="int">
|
SELECT
|
count(1)
|
FROM sys_flow_history_process a
|
<if test='type =="0"'>
|
inner join sys_flow_history_task b
|
</if>
|
<if test='type =="1"'>
|
inner join SYS_FLOW_RUNTIME_EXECUTION b
|
</if>
|
<if test='type =="2"'>
|
left join sys_flow_history_task b
|
</if>
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where a.START_USER_ID=#{userId}
|
<if test='type =="0"'>
|
and a.START_ACTIVITY_ID=b.TASK_DEFINITION_ID
|
and b.END_TIME is null
|
and a.END_TIME is null
|
and b.is_circulate=0
|
and b.ASSIGNEE_USER_ID=#{userId}
|
</if>
|
<if test='type =="1"'>
|
and a.END_TIME is null
|
and b.PARENT_EXECUTION_ID!=0
|
and a.START_ACTIVITY_ID!=b.ACTIVITY_ID
|
</if>
|
<if test='type =="2"'>
|
and a.END_TIME is not null
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
</select>
|
|
<!--获取待阅列表-->
|
<select id="findWaitReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="mysql">
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=0 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY IFNULL(a.emergency_degree_code,-1) desc,b.start_time DESC
|
limit #{currIndex} ,
|
#{pageSize}
|
</select>
|
<select id="findWaitReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="oracle">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=0 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.start_time DESC,NVL(a.emergency_degree_code,-1) desc
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findWaitReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="kingbasees">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.emergency_degree_code,a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=0 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.start_time DESC,NVL(a.emergency_degree_code,-1) desc
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
|
<!--获取待阅数量-->
|
<select id="findWaitReadTasksCountByAssigneeId" parameterType="map" resultType="int">
|
SELECT
|
count(1)
|
FROM sys_flow_history_process a,sys_flow_history_task b,cnf_module f
|
WHERE a.process_instance_id = b.process_instance_id and a.module_id = f.module_id and circulate_state=0 and
|
is_circulate=1
|
<if test="type!=null and type =='0'.toString()">
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test="type!=null and type =='1'.toString()">
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
</select>
|
|
<!--获取已阅列表-->
|
<select id="findDoneReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="mysql">
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=1 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.start_time DESC
|
limit #{currIndex} ,
|
#{pageSize}
|
</select>
|
<select id="findDoneReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="oracle">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=1 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.start_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
<select id="findDoneReadTasksByAssigneeId" parameterType="map"
|
resultType="com.ruili.wcp.data.vo.management.PendingTaskVO" databaseId="kingbasees">
|
SELECT * FROM (
|
SELECT A.*, ROWNUM AS rn FROM (
|
SELECT
|
a.flow_definition_name, a.process_instance_name as
|
execution_name,a.module_id,a.table_id,a.key_id,a.business_view_url,a.file_code,a.create_unit,b.*,
|
f.module_name
|
FROM sys_flow_history_process a left join sys_flow_history_task b
|
on a.process_instance_id = b.process_instance_id
|
left join cnf_module f on a.module_id = f.module_id
|
where 1=1 and circulate_state=1 and is_circulate=1
|
<if test='type!=null and type =="0"'>
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test='type!=null and type =="1"'>
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
ORDER BY b.start_time DESC
|
) A
|
) WHERE rn BETWEEN ${currIndex} AND (${currIndex} + ${pageSize})
|
</select>
|
|
<!--获取已阅数量-->
|
<select id="findDoneReadTasksCountByAssigneeId" parameterType="map" resultType="int">
|
SELECT
|
count(1)
|
FROM sys_flow_history_process a,sys_flow_history_task b,cnf_module f
|
WHERE a.process_instance_id = b.process_instance_id and a.module_id = f.module_id and circulate_state=1 and
|
is_circulate=1
|
<if test="type!=null and type =='0'.toString()">
|
and b.assignee_type=0 and b.assignee_user_id= #{userId}
|
</if>
|
<if test="type!=null and type =='1'.toString()">
|
and b.assignee_type>0 and b.assignee_user_id in(
|
select group_id from sys_group_user p,sys_account q where p.user_id=q.user_id and q.user_id=#{userId}
|
)
|
</if>
|
<if test="searchKey != null and searchKey != ''">
|
and a.process_instance_name like '%${searchKey}%'
|
</if>
|
<if test="flowDefinitionId != null and flowDefinitionId != ''">
|
and a.flow_definition_id = #{flowDefinitionId}
|
</if>
|
<if test="moduleId != null and moduleId != ''">
|
and f.module_id = #{moduleId}
|
</if>
|
</select>
|
</mapper>
|