|
|
@ -2,27 +2,26 @@ |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<!-- rqrq - 流程实例Mapper XML --> |
|
|
<!-- rqrq - 流程实例Mapper XML --> |
|
|
<mapper namespace="com.xujie.modules.workFlow.mapper.ErfFlowInstanceMapper"> |
|
|
<mapper namespace="com.xujie.modules.workFlow.mapper.ErfFlowInstanceMapper"> |
|
|
|
|
|
|
|
|
<!-- 查询流程实例列表(分页) - rqrq --> |
|
|
<!-- 查询流程实例列表(分页) - rqrq --> |
|
|
<select id="searchInstanceList" resultType="ErfFlowInstanceData"> |
|
|
<select id="searchInstanceList" resultType="ErfFlowInstanceData"> |
|
|
SELECT |
|
|
SELECT |
|
|
i.apply_no, |
|
|
|
|
|
i.order_ref1, |
|
|
|
|
|
i.site, |
|
|
|
|
|
i.order_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version, |
|
|
|
|
|
i.status, |
|
|
|
|
|
i.current_node_code, |
|
|
|
|
|
i.start_time, |
|
|
|
|
|
i.end_time, |
|
|
|
|
|
i.remark, |
|
|
|
|
|
t.flow_name, |
|
|
|
|
|
n.node_name AS currentNodeName |
|
|
|
|
|
|
|
|
i.apply_no, |
|
|
|
|
|
i.order_ref1, |
|
|
|
|
|
i.site, |
|
|
|
|
|
i.order_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version, |
|
|
|
|
|
i.status, |
|
|
|
|
|
i.current_node_code, |
|
|
|
|
|
i.start_time, |
|
|
|
|
|
i.end_time, |
|
|
|
|
|
i.remark, |
|
|
|
|
|
t.flow_name, |
|
|
|
|
|
n.node_name AS currentNodeName |
|
|
FROM erf_flow_instance i |
|
|
FROM erf_flow_instance i |
|
|
LEFT JOIN erf_flow_template t ON t.flow_code = i.flow_code AND t.flow_version = i.flow_version AND t.site = i.site |
|
|
LEFT JOIN erf_flow_template t ON t.flow_code = i.flow_code AND t.flow_version = i.flow_version AND t.site = i.site |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
AND n.site = i.site AND n.node_code = i.current_node_code |
|
|
|
|
|
|
|
|
AND n.site = i.site AND n.node_code = i.current_node_code |
|
|
<where> |
|
|
<where> |
|
|
<if test="query.site != null and query.site != ''"> |
|
|
<if test="query.site != null and query.site != ''"> |
|
|
AND i.site = #{query.site} |
|
|
AND i.site = #{query.site} |
|
|
@ -44,58 +43,56 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 查询节点实例列表 --> |
|
|
<!-- 查询节点实例列表 --> |
|
|
<select id="searchNodeInstanceList" resultType="ErfFlowNodeInstanceData"> |
|
|
|
|
|
|
|
|
<select id="searchNodeInstanceList" resultType="ErfFlowNodeInstanceData"> |
|
|
SELECT |
|
|
SELECT |
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.task_seq, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.department_id, |
|
|
|
|
|
ni.department_name, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
ni.duration_seconds, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type |
|
|
|
|
|
|
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.department_id, |
|
|
|
|
|
ni.department_name, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
ni.duration_seconds, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type |
|
|
FROM erf_flow_node_instance ni |
|
|
FROM erf_flow_node_instance ni |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
|
|
|
|
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
|
|
|
ORDER BY n.node_order, ni.attempt_no, ni.task_seq |
|
|
|
|
|
|
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
|
|
|
ORDER BY n.node_order, ni.attempt_no |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 插入流程实例 - rqrq --> |
|
|
<!-- 插入流程实例 - rqrq --> |
|
|
<insert id="insertInstance"> |
|
|
<insert id="insertInstance"> |
|
|
INSERT INTO erf_flow_instance ( |
|
|
INSERT INTO erf_flow_instance ( |
|
|
apply_no, order_ref1, site, order_type, flow_code, flow_version, |
|
|
|
|
|
status, current_node_code, start_time |
|
|
|
|
|
|
|
|
apply_no, order_ref1, site, order_type, flow_code, flow_version, |
|
|
|
|
|
status, current_node_code, start_time |
|
|
) VALUES ( |
|
|
) VALUES ( |
|
|
#{applyNo}, #{orderRef1}, #{site}, #{orderType}, #{flowCode}, #{flowVersion}, |
|
|
|
|
|
#{status}, #{currentNodeCode}, GETDATE() |
|
|
|
|
|
|
|
|
#{applyNo}, #{orderRef1}, #{site}, #{orderType}, #{flowCode}, #{flowVersion}, |
|
|
|
|
|
#{status}, #{currentNodeCode}, GETDATE() |
|
|
) |
|
|
) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<!-- 插入节点实例 --> |
|
|
<!-- 插入节点实例 --> |
|
|
<!-- rqrq -插入节点实例(含 task_seq、assignee_username,支持会签/或签多行) --> |
|
|
|
|
|
<insert id="insertNodeInstance"> |
|
|
<insert id="insertNodeInstance"> |
|
|
INSERT INTO erf_flow_node_instance ( |
|
|
INSERT INTO erf_flow_node_instance ( |
|
|
apply_no, node_code, attempt_no, task_seq, site, order_type, |
|
|
|
|
|
department_id, department_name, assignee_user_id, assignee_username, assignee_name, status, receive_time |
|
|
|
|
|
|
|
|
apply_no, node_code, attempt_no, site, order_type, assignee_username, |
|
|
|
|
|
department_id, department_name, assignee_user_id, assignee_name, status, receive_time, special_release |
|
|
) VALUES ( |
|
|
) VALUES ( |
|
|
#{applyNo}, #{nodeCode}, #{attemptNo}, #{taskSeq}, #{site}, #{orderType}, |
|
|
|
|
|
#{departmentId}, #{departmentName}, #{assigneeUserId}, #{assigneeUsername}, #{assigneeName}, #{status}, GETDATE() |
|
|
|
|
|
|
|
|
#{applyNo}, #{nodeCode}, #{attemptNo}, #{site}, #{orderType}, #{assigneeUsername}, |
|
|
|
|
|
#{departmentId}, #{departmentName}, #{assigneeUserId}, #{assigneeName}, #{status}, GETDATE(), #{specialRelease} |
|
|
) |
|
|
) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
@ -103,89 +100,87 @@ |
|
|
<update id="updateInstanceStatus"> |
|
|
<update id="updateInstanceStatus"> |
|
|
UPDATE erf_flow_instance |
|
|
UPDATE erf_flow_instance |
|
|
SET status = #{status}, |
|
|
SET status = #{status}, |
|
|
current_node_code = #{currentNodeCode} |
|
|
|
|
|
|
|
|
current_node_code = #{currentNodeCode} |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<!-- 更新流程实例完成 --> |
|
|
<!-- 更新流程实例完成 --> |
|
|
<update id="updateInstanceCompleted"> |
|
|
<update id="updateInstanceCompleted"> |
|
|
UPDATE erf_flow_instance |
|
|
UPDATE erf_flow_instance |
|
|
SET status = 'COMPLETED', |
|
|
SET status = 'COMPLETED', |
|
|
end_time = GETDATE() |
|
|
|
|
|
|
|
|
end_time = GETDATE() |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<!-- 更新节点实例状态 --> |
|
|
<!-- 更新节点实例状态 --> |
|
|
<update id="updateNodeInstanceStatus"> |
|
|
<update id="updateNodeInstanceStatus"> |
|
|
UPDATE erf_flow_node_instance |
|
|
UPDATE erf_flow_node_instance |
|
|
SET status = #{status}, |
|
|
SET status = #{status}, |
|
|
comment = #{comment}, |
|
|
|
|
|
special_release = #{specialRelease}, |
|
|
|
|
|
complete_time = GETDATE() |
|
|
|
|
|
|
|
|
comment = #{comment}, |
|
|
|
|
|
special_release = #{specialRelease}, |
|
|
|
|
|
complete_time = GETDATE() |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND task_seq = #{taskSeq} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND assignee_username = #{assigneeUsername} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<!-- 获取节点实例详情 --> |
|
|
<!-- 获取节点实例详情 --> |
|
|
<select id="getNodeInstanceDetail" resultType="ErfFlowNodeInstanceData"> |
|
|
<select id="getNodeInstanceDetail" resultType="ErfFlowNodeInstanceData"> |
|
|
SELECT |
|
|
SELECT |
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.task_seq, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version |
|
|
|
|
|
|
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version |
|
|
FROM erf_flow_node_instance ni |
|
|
FROM erf_flow_node_instance ni |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
|
|
|
|
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
AND ni.node_code = #{nodeCode} |
|
|
|
|
|
AND ni.attempt_no = #{attemptNo} |
|
|
|
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND ni.node_code = #{nodeCode} |
|
|
|
|
|
AND ni.attempt_no = #{attemptNo} |
|
|
|
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 获取流程实例 - rqrq --> |
|
|
<!-- 获取流程实例 - rqrq --> |
|
|
<select id="getInstanceByApplyNo" resultType="ErfFlowInstanceData"> |
|
|
<select id="getInstanceByApplyNo" resultType="ErfFlowInstanceData"> |
|
|
SELECT |
|
|
SELECT |
|
|
i.apply_no, |
|
|
|
|
|
i.order_ref1, |
|
|
|
|
|
i.site, |
|
|
|
|
|
i.order_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version, |
|
|
|
|
|
i.status, |
|
|
|
|
|
i.current_node_code, |
|
|
|
|
|
i.start_time, |
|
|
|
|
|
i.end_time, |
|
|
|
|
|
t.flow_name |
|
|
|
|
|
|
|
|
i.apply_no, |
|
|
|
|
|
i.order_ref1, |
|
|
|
|
|
i.site, |
|
|
|
|
|
i.order_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version, |
|
|
|
|
|
i.status, |
|
|
|
|
|
i.current_node_code, |
|
|
|
|
|
i.start_time, |
|
|
|
|
|
i.end_time, |
|
|
|
|
|
t.flow_name |
|
|
FROM erf_flow_instance i |
|
|
FROM erf_flow_instance i |
|
|
LEFT JOIN erf_flow_template t ON t.flow_code = i.flow_code AND t.flow_version = i.flow_version AND t.site = i.site |
|
|
LEFT JOIN erf_flow_template t ON t.flow_code = i.flow_code AND t.flow_version = i.flow_version AND t.site = i.site |
|
|
WHERE i.apply_no = #{applyNo} |
|
|
WHERE i.apply_no = #{applyNo} |
|
|
AND i.site = #{site} |
|
|
|
|
|
AND i.order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND i.site = #{site} |
|
|
|
|
|
AND i.order_type = #{orderType} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 获取当前节点的最大尝试次数 --> |
|
|
<!-- 获取当前节点的最大尝试次数 --> |
|
|
@ -193,120 +188,123 @@ |
|
|
SELECT ISNULL(MAX(attempt_no), 0) |
|
|
SELECT ISNULL(MAX(attempt_no), 0) |
|
|
FROM erf_flow_node_instance |
|
|
FROM erf_flow_node_instance |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 获取待审批的节点实例 --> |
|
|
|
|
|
<!-- rqrq - 待办按审批人精确匹配,避免会签多人时取错行 --> |
|
|
|
|
|
|
|
|
<!-- 获取待审批的节点实例(当前登录人对应的一条;assignee_username 与 approver_username 一致) --> |
|
|
<select id="getPendingNodeInstance" resultType="ErfFlowNodeInstanceData"> |
|
|
<select id="getPendingNodeInstance" resultType="ErfFlowNodeInstanceData"> |
|
|
SELECT TOP 1 |
|
|
SELECT TOP 1 |
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.task_seq, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
n.node_type |
|
|
|
|
|
|
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
n.node_type |
|
|
FROM erf_flow_node_instance ni |
|
|
FROM erf_flow_node_instance ni |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
|
|
|
|
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
WHERE ni.apply_no = #{applyNo} |
|
|
AND ni.node_code = #{nodeCode} |
|
|
|
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
|
|
|
AND ni.status = 'PENDING' |
|
|
|
|
|
AND ( |
|
|
|
|
|
(ni.assignee_username IS NOT NULL AND ni.assignee_username = #{assigneeUsername}) |
|
|
|
|
|
OR (ni.assignee_username IS NULL AND ni.assignee_name = #{assigneeDisplayName}) |
|
|
|
|
|
) |
|
|
|
|
|
ORDER BY ni.attempt_no DESC, ni.task_seq ASC |
|
|
|
|
|
|
|
|
AND ni.node_code = #{nodeCode} |
|
|
|
|
|
AND ni.site = #{site} |
|
|
|
|
|
AND ni.order_type = #{orderType} |
|
|
|
|
|
AND ni.status = 'PENDING' |
|
|
|
|
|
AND ( |
|
|
|
|
|
ni.assignee_username = #{assigneeUsername} |
|
|
|
|
|
OR (ISNULL(ni.assignee_username, N'') = N'' AND ni.assignee_name = #{assigneeName}) |
|
|
|
|
|
) |
|
|
|
|
|
ORDER BY ni.attempt_no DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- rqrq - 当前节点轮次待办数量 --> |
|
|
|
|
|
<select id="countPendingNodeTasks" resultType="int"> |
|
|
|
|
|
|
|
|
<select id="countPendingForNode" resultType="int"> |
|
|
SELECT COUNT(1) |
|
|
SELECT COUNT(1) |
|
|
FROM erf_flow_node_instance |
|
|
FROM erf_flow_node_instance |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND status = 'PENDING' |
|
|
|
|
|
|
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND status = 'PENDING' |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- rqrq - 批量关闭同节点其他待办(或签跳过 / 驳回关闭) --> |
|
|
|
|
|
<update id="updateOtherPendingNodeTasks"> |
|
|
|
|
|
|
|
|
<select id="countPendingNodeInstances" resultType="int"> |
|
|
|
|
|
SELECT COUNT(1) |
|
|
|
|
|
FROM erf_flow_node_instance |
|
|
|
|
|
WHERE apply_no = #{applyNo} |
|
|
|
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND status = 'PENDING' |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<update id="skipRemainingPendingOnSameNodeAttempt"> |
|
|
UPDATE erf_flow_node_instance |
|
|
UPDATE erf_flow_node_instance |
|
|
SET status = #{newStatus}, |
|
|
|
|
|
comment = #{comment}, |
|
|
|
|
|
complete_time = GETDATE() |
|
|
|
|
|
|
|
|
SET status = #{targetStatus}, |
|
|
|
|
|
comment = #{comment}, |
|
|
|
|
|
complete_time = GETDATE() |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND status = 'PENDING' |
|
|
|
|
|
AND task_seq <> #{excludeTaskSeq} |
|
|
|
|
|
|
|
|
AND node_code = #{nodeCode} |
|
|
|
|
|
AND attempt_no = #{attemptNo} |
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
AND status = 'PENDING' |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 删除指定单据的所有节点实例 - rqrq --> |
|
|
<!-- 删除指定单据的所有节点实例 - rqrq --> |
|
|
<delete id="deleteNodeInstancesByApplyNo"> |
|
|
<delete id="deleteNodeInstancesByApplyNo"> |
|
|
DELETE FROM erf_flow_node_instance |
|
|
DELETE FROM erf_flow_node_instance |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<!-- 重启流程实例 - rqrq --> |
|
|
<!-- 重启流程实例 - rqrq --> |
|
|
<update id="restartInstance"> |
|
|
<update id="restartInstance"> |
|
|
UPDATE erf_flow_instance |
|
|
UPDATE erf_flow_instance |
|
|
SET status = 'RUNNING', |
|
|
SET status = 'RUNNING', |
|
|
current_node_code = #{currentNodeCode}, |
|
|
|
|
|
start_time = GETDATE(), |
|
|
|
|
|
end_time = NULL |
|
|
|
|
|
|
|
|
current_node_code = #{currentNodeCode}, |
|
|
|
|
|
start_time = GETDATE(), |
|
|
|
|
|
end_time = NULL |
|
|
WHERE apply_no = #{applyNo} |
|
|
WHERE apply_no = #{applyNo} |
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
<select id="nodeInstanceList" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeInstanceData"> |
|
|
<select id="nodeInstanceList" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeInstanceData"> |
|
|
SELECT |
|
|
SELECT |
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.task_seq, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
ni.department_name, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version |
|
|
|
|
|
|
|
|
ni.apply_no, |
|
|
|
|
|
ni.node_code, |
|
|
|
|
|
ni.attempt_no, |
|
|
|
|
|
ni.site, |
|
|
|
|
|
ni.order_type, |
|
|
|
|
|
ni.assignee_username, |
|
|
|
|
|
ni.assignee_user_id, |
|
|
|
|
|
ni.assignee_name, |
|
|
|
|
|
ni.status, |
|
|
|
|
|
ni.comment, |
|
|
|
|
|
ni.special_release, |
|
|
|
|
|
ni.receive_time, |
|
|
|
|
|
ni.complete_time, |
|
|
|
|
|
ni.department_name, |
|
|
|
|
|
n.node_name, |
|
|
|
|
|
n.node_order, |
|
|
|
|
|
n.approve_type, |
|
|
|
|
|
i.flow_code, |
|
|
|
|
|
i.flow_version |
|
|
FROM erf_flow_node_instance ni |
|
|
FROM erf_flow_node_instance ni |
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
|
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
|
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
|
|
|
|
|
|
LEFT JOIN erf_flow_instance i ON i.apply_no = ni.apply_no AND i.site = ni.site AND i.order_type = ni.order_type |
|
|
|
|
|
LEFT JOIN erf_flow_node n ON n.flow_code = i.flow_code AND n.flow_version = i.flow_version |
|
|
|
|
|
AND n.site = i.site AND n.node_code = ni.node_code |
|
|
WHERE ni.site = #{site} |
|
|
WHERE ni.site = #{site} |
|
|
<if test="applyNo != null and applyNo != '' "> and ni.apply_no = #{applyNo}</if> |
|
|
<if test="applyNo != null and applyNo != '' "> and ni.apply_no = #{applyNo}</if> |
|
|
<if test="status != null and status != '' "> and ni.status = #{status}</if> |
|
|
<if test="status != null and status != '' "> and ni.status = #{status}</if> |
|
|
@ -314,10 +312,10 @@ |
|
|
</select> |
|
|
</select> |
|
|
<select id="searchNodeApproverList" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeApproverData"> |
|
|
<select id="searchNodeApproverList" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeApproverData"> |
|
|
SELECT |
|
|
SELECT |
|
|
na.node_id, |
|
|
|
|
|
na.approver_username, |
|
|
|
|
|
na.approver_name, |
|
|
|
|
|
na.approver_order |
|
|
|
|
|
|
|
|
na.node_id, |
|
|
|
|
|
na.approver_username, |
|
|
|
|
|
na.approver_name, |
|
|
|
|
|
na.approver_order |
|
|
from erf_flow_node_approver na |
|
|
from erf_flow_node_approver na |
|
|
left join erf_flow_node n on n.id = na.node_id |
|
|
left join erf_flow_node n on n.id = na.node_id |
|
|
left join erf_flow_node_instance ni on ni.node_code = n.node_code |
|
|
left join erf_flow_node_instance ni on ni.node_code = n.node_code |
|
|
@ -329,18 +327,19 @@ |
|
|
|
|
|
|
|
|
<select id="getInstanceByOrderRef1" resultType="com.xujie.modules.workFlow.entity.ErfFlowInstance"> |
|
|
<select id="getInstanceByOrderRef1" resultType="com.xujie.modules.workFlow.entity.ErfFlowInstance"> |
|
|
SELECT apply_no, order_ref1, site, order_type, flow_code, flow_version, |
|
|
SELECT apply_no, order_ref1, site, order_type, flow_code, flow_version, |
|
|
status, current_node_code |
|
|
|
|
|
|
|
|
status, current_node_code |
|
|
FROM erf_flow_instance |
|
|
FROM erf_flow_instance |
|
|
WHERE order_ref1 = #{orderRef1} |
|
|
WHERE order_ref1 = #{orderRef1} |
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
|
|
|
AND order_type = #{orderType} |
|
|
</select> |
|
|
</select> |
|
|
<select id="getFlowNodeData" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeData"> |
|
|
<select id="getFlowNodeData" resultType="com.xujie.modules.workFlow.data.ErfFlowNodeData"> |
|
|
SELECT |
|
|
SELECT |
|
|
id,node_code,node_name,node_order,node_type,approve_type,site,flow_code,flow_version,department_id,department_name |
|
|
|
|
|
|
|
|
id,node_code,node_name,node_order,node_type,approve_type,site,flow_code,flow_version,department_id,department_name |
|
|
FROM erf_flow_node |
|
|
FROM erf_flow_node |
|
|
WHERE node_code = #{nodeCode} |
|
|
WHERE node_code = #{nodeCode} |
|
|
AND site = #{site} |
|
|
|
|
|
|
|
|
AND site = #{site} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |