|
@@ -6,122 +6,129 @@
|
|
|
select ARP.ID_ from ACT_RE_PROCDEF ARP where ARP.DEPLOYMENT_ID_ = #{deploymentId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getFlowTaskList" resultType="com.qmth.sop.business.bean.result.WorkTaskResult">
|
|
|
+ <sql id="flowTaskListCommonSql">
|
|
|
+ (select
|
|
|
+ cast(art.ASSIGNEE_ as Decimal(24)) as userId,
|
|
|
+ tfcf.type,
|
|
|
+ tfcfe.code,
|
|
|
+ tffa.status,
|
|
|
+ tffa.setup,
|
|
|
+ tfcf.version,
|
|
|
+ tfcfe.obj_id as objId,
|
|
|
+ tfcfe.crm_no as crmNo,
|
|
|
+ tbc.name as crmName,
|
|
|
+ tbs.id as serviceId,
|
|
|
+ tbs.name as serviceName,
|
|
|
+ tbs.type as serviceType,
|
|
|
+ sc.id as customId,
|
|
|
+ sc.type as customType,
|
|
|
+ sc.name as customName,
|
|
|
+ tfcfe.create_id as createId,
|
|
|
+ su.real_name as createRealName,
|
|
|
+ art.PROC_INST_ID_ as flowId,
|
|
|
+ art.NAME_ as taskName,
|
|
|
+ art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
+ art.ID_ as taskId,
|
|
|
+ tfcfe.flow_process_var as flowProcessVar,
|
|
|
+ tfcfe.t_f_custom_flow_id as customFlowId,
|
|
|
+ tfcf.flow_deployment_id as flowDeploymentId,
|
|
|
+ tfcfe.id as customFlowEntityid,
|
|
|
+ tffa.update_time as flowTime,
|
|
|
+ datediff(now(),FROM_UNIXTIME(tffa.update_time / 1000,'%Y-%m-%d %H:%i:%s')) as diffTime,
|
|
|
+ 24 - TIMESTAMPDIFF(HOUR,DATE_FORMAT(FROM_UNIXTIME(tsjr.exec_time / 1000), '%Y-%m-%d %H:%i:%s'),NOW()) as processHour
|
|
|
+ from
|
|
|
+ ACT_RU_TASK art
|
|
|
+ left join t_f_flow_approve tffa on art.PROC_INST_ID_ = tffa.flow_id
|
|
|
+ left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
|
|
|
+ left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
|
|
|
+ left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
|
|
|
+ left join t_b_service tbs on tbs.id = tbc.service_id
|
|
|
+ left join sys_custom sc on sc.id = tbc.custom_id
|
|
|
+ left join sys_user su ON tfcfe.create_id = su.id
|
|
|
+ left join t_s_job_remind tsjr on tsjr.code = tfcfe.code
|
|
|
+ <where> 1 = 1
|
|
|
+ and art.ASSIGNEE_ = cast(#{userId} as char)
|
|
|
+ <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
|
|
|
+ and tffa.status = #{flowTaskTypeEnum}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and tfcf.type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="customName != null and customName != ''">
|
|
|
+ and sc.name like concat('%', #{customName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ UNION ALL
|
|
|
select
|
|
|
- t.*
|
|
|
+ cast(ari.USER_ID_ as Decimal(24)) as userId,
|
|
|
+ tfcf.type,
|
|
|
+ tfcfe.code,
|
|
|
+ tffa.status,
|
|
|
+ tffa.setup,
|
|
|
+ tfcf.version,
|
|
|
+ tfcfe.obj_id as objId,
|
|
|
+ tfcfe.crm_no as crmNo,
|
|
|
+ tbc.name as crmName,
|
|
|
+ tbs.id as serviceId,
|
|
|
+ tbs.name as serviceName,
|
|
|
+ tbs.type as serviceType,
|
|
|
+ sc.id as customId,
|
|
|
+ sc.type as customType,
|
|
|
+ sc.name as customName,
|
|
|
+ tfcfe.create_id as createId,
|
|
|
+ su.real_name as createRealName,
|
|
|
+ art.PROC_INST_ID_ as flowId,
|
|
|
+ art.NAME_ as taskName,
|
|
|
+ art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
+ art.ID_ as taskId,
|
|
|
+ tfcfe.flow_process_var as flowProcessVar,
|
|
|
+ tfcfe.t_f_custom_flow_id as customFlowId,
|
|
|
+ tfcf.flow_deployment_id as flowDeploymentId,
|
|
|
+ tfcfe.id as customFlowEntityid,
|
|
|
+ tffa.update_time as flowTime,
|
|
|
+ datediff(now(),FROM_UNIXTIME(tffa.update_time / 1000,'%Y-%m-%d %H:%i:%s')) as diffTime,
|
|
|
+ 24 - TIMESTAMPDIFF(HOUR,DATE_FORMAT(FROM_UNIXTIME(tsjr.exec_time / 1000), '%Y-%m-%d %H:%i:%s'),NOW()) as processHour
|
|
|
from
|
|
|
- (select
|
|
|
- cast(art.ASSIGNEE_ as Decimal(24)) as userId,
|
|
|
- tfcf.type,
|
|
|
- tfcfe.code,
|
|
|
- tffa.status,
|
|
|
- tffa.setup,
|
|
|
- tfcf.version,
|
|
|
- tfcfe.obj_id as objId,
|
|
|
- tfcfe.crm_no as crmNo,
|
|
|
- tbc.name as crmName,
|
|
|
- tbs.id as serviceId,
|
|
|
- tbs.name as serviceName,
|
|
|
- tbs.type as serviceType,
|
|
|
- sc.id as customId,
|
|
|
- sc.type as customType,
|
|
|
- sc.name as customName,
|
|
|
- tfcfe.create_id as createId,
|
|
|
- su.real_name as createRealName,
|
|
|
- art.PROC_INST_ID_ as flowId,
|
|
|
- art.NAME_ as taskName,
|
|
|
- art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
- art.ID_ as taskId,
|
|
|
- tfcfe.flow_process_var as flowProcessVar,
|
|
|
- tfcfe.t_f_custom_flow_id as customFlowId,
|
|
|
- tfcf.flow_deployment_id as flowDeploymentId,
|
|
|
- tfcfe.id as customFlowEntityid,
|
|
|
- tffa.update_time as flowTime,
|
|
|
- datediff(now(),FROM_UNIXTIME(tffa.update_time / 1000,'%Y-%m-%d %H:%i:%s')) as diffTime,
|
|
|
- 24 - TIMESTAMPDIFF(HOUR,DATE_FORMAT(FROM_UNIXTIME(tsjr.exec_time / 1000), '%Y-%m-%d %H:%i:%s'),NOW()) as processHour
|
|
|
- from
|
|
|
- ACT_RU_TASK art
|
|
|
- left join t_f_flow_approve tffa on art.PROC_INST_ID_ = tffa.flow_id
|
|
|
- left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
|
|
|
- left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
|
|
|
- left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
|
|
|
- left join t_b_service tbs on tbs.id = tbc.service_id
|
|
|
- left join sys_custom sc on sc.id = tbc.custom_id
|
|
|
- left join sys_user su ON tfcfe.create_id = su.id
|
|
|
- left join t_s_job_remind tsjr on tsjr.code = tfcfe.code
|
|
|
- <where> 1 = 1
|
|
|
- and art.ASSIGNEE_ = cast(#{userId} as char)
|
|
|
- <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
|
|
|
- and tffa.status = #{flowTaskTypeEnum}
|
|
|
- </if>
|
|
|
- <if test="type != null and type != ''">
|
|
|
- and tfcf.type = #{type}
|
|
|
- </if>
|
|
|
- <if test="customName != null and customName != ''">
|
|
|
- and sc.name like concat('%', #{customName}, '%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- UNION ALL
|
|
|
- select
|
|
|
- cast(ari.USER_ID_ as Decimal(24)) as userId,
|
|
|
- tfcf.type,
|
|
|
- tfcfe.code,
|
|
|
- tffa.status,
|
|
|
- tffa.setup,
|
|
|
- tfcf.version,
|
|
|
- tfcfe.obj_id as objId,
|
|
|
- tfcfe.crm_no as crmNo,
|
|
|
- tbc.name as crmName,
|
|
|
- tbs.id as serviceId,
|
|
|
- tbs.name as serviceName,
|
|
|
- tbs.type as serviceType,
|
|
|
- sc.id as customId,
|
|
|
- sc.type as customType,
|
|
|
- sc.name as customName,
|
|
|
- tfcfe.create_id as createId,
|
|
|
- su.real_name as createRealName,
|
|
|
- art.PROC_INST_ID_ as flowId,
|
|
|
- art.NAME_ as taskName,
|
|
|
- art.TASK_DEF_KEY_ as taskDefKey,
|
|
|
- art.ID_ as taskId,
|
|
|
- tfcfe.flow_process_var as flowProcessVar,
|
|
|
- tfcfe.t_f_custom_flow_id as customFlowId,
|
|
|
- tfcf.flow_deployment_id as flowDeploymentId,
|
|
|
- tfcfe.id as customFlowEntityid,
|
|
|
- tffa.update_time as flowTime,
|
|
|
- datediff(now(),FROM_UNIXTIME(tffa.update_time / 1000,'%Y-%m-%d %H:%i:%s')) as diffTime,
|
|
|
- 24 - TIMESTAMPDIFF(HOUR,DATE_FORMAT(FROM_UNIXTIME(tsjr.exec_time / 1000), '%Y-%m-%d %H:%i:%s'),NOW()) as processHour
|
|
|
- from
|
|
|
- ACT_RU_TASK art
|
|
|
- left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
|
|
|
- left join t_f_flow_approve tffa on tffa.flow_id = art.PROC_INST_ID_
|
|
|
- left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
|
|
|
- left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
|
|
|
- left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
|
|
|
- left join t_b_service tbs on tbs.id = tbc.service_id
|
|
|
- left join sys_custom sc on sc.id = tbc.custom_id
|
|
|
- left join sys_user su ON tfcfe.create_id = su.id
|
|
|
- left join t_s_job_remind tsjr on tsjr.code = tfcfe.code
|
|
|
- <where> 1 = 1
|
|
|
- and art.ASSIGNEE_ is null
|
|
|
- and ari.USER_ID_ = cast(#{userId} as char)
|
|
|
- and ari.TYPE_ = 'candidate'
|
|
|
- <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
|
|
|
- and tffa.status = #{flowTaskTypeEnum}
|
|
|
- </if>
|
|
|
- <if test="type != null and type != ''">
|
|
|
- and tfcf.type = #{type}
|
|
|
- </if>
|
|
|
- <if test="customName != null and customName != ''">
|
|
|
- and sc.name like concat('%', #{customName}, '%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) t
|
|
|
+ ACT_RU_TASK art
|
|
|
+ left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
|
|
|
+ left join t_f_flow_approve tffa on tffa.flow_id = art.PROC_INST_ID_
|
|
|
+ left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
|
|
|
+ left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
|
|
|
+ left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
|
|
|
+ left join t_b_service tbs on tbs.id = tbc.service_id
|
|
|
+ left join sys_custom sc on sc.id = tbc.custom_id
|
|
|
+ left join sys_user su ON tfcfe.create_id = su.id
|
|
|
+ left join t_s_job_remind tsjr on tsjr.code = tfcfe.code
|
|
|
+ <where> 1 = 1
|
|
|
+ and art.ASSIGNEE_ is null
|
|
|
+ and ari.USER_ID_ = cast(#{userId} as char)
|
|
|
+ and ari.TYPE_ = 'candidate'
|
|
|
+ <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
|
|
|
+ and tffa.status = #{flowTaskTypeEnum}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and tfcf.type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="customName != null and customName != ''">
|
|
|
+ and sc.name like concat('%', #{customName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) t
|
|
|
<where>
|
|
|
<if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'OVER_TIME'">
|
|
|
and t.diffTime <![CDATA[ >= ]]> 1
|
|
|
</if>
|
|
|
</where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getFlowTaskList" resultType="com.qmth.sop.business.bean.result.WorkTaskResult">
|
|
|
+ select t.* from
|
|
|
+ <include refid="flowTaskListCommonSql" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFlowTaskListCount" resultType="java.lang.Integer">
|
|
|
+ select count(1) from
|
|
|
+ <include refid="flowTaskListCommonSql" />
|
|
|
</select>
|
|
|
|
|
|
<select id="findSysUserResultList" resultType="com.qmth.sop.business.bean.result.SysUserResult">
|