|
@@ -563,12 +563,12 @@
|
|
|
node.name AS nodeName,
|
|
|
node.code AS nodeCode,
|
|
|
log.created AS finishTime,
|
|
|
- instance.business_sub_id AS statementNo,
|
|
|
+ nodeInfo.business_sub_id AS statementNo,
|
|
|
(SELECT assets_name FROM assets_production WHERE assets_production.production_no = instance.business_sub_id) AS
|
|
|
statementName,
|
|
|
(SELECT assets_name FROM assets_production WHERE assets_production.production_no = instance.business_min_id limit 1) AS
|
|
|
reportName,
|
|
|
- instance.business_min_id AS reportNo,
|
|
|
+ nodeInfo.business_min_id AS reportNo,
|
|
|
instance.state AS instanceState,
|
|
|
instance.id AS instanceId,
|
|
|
instance.created AS startDate
|
|
@@ -583,6 +583,14 @@
|
|
|
AND work_flow_node_instance.deleted = 0) AS instance ON log.instance_id = instance.id
|
|
|
LEFT JOIN (SELECT id, name, code FROM work_node WHERE deleted = 0) AS node ON node.id = instance.node_id
|
|
|
LEFT JOIN (SELECT id, order_id, name, department_id FROM assets WHERE deleted = 0) AS assets ON assets.id = log.business_id
|
|
|
+ LEFT JOIN (SELECT nodeInstance.business_id AS businessId,
|
|
|
+ nodeInstance.business_sub_id,
|
|
|
+ nodeInstance.business_min_id
|
|
|
+ FROM work_flow_node_instance AS nodeInstance
|
|
|
+ WHERE state = 'PENDING'
|
|
|
+ AND nodeInstance.business_type = 'ASSET_BUSINESS'
|
|
|
+ AND deleted = 0
|
|
|
+ ) AS nodeInfo ON nodeInfo.businessId = instance.business_id AND IF(instance.business_sub_id IS NOT NULL, nodeInfo.business_sub_id = instance.business_sub_id, TRUE) AND IF(instance.business_min_id IS NOT NULL, nodeInfo.business_min_id = instance.business_min_id, TRUE)
|
|
|
LEFT JOIN user ON user.id = log.handler_id
|
|
|
<if test="assetsSelectDTO != null and assetsSelectDTO.selectByDepartment">
|
|
|
INNER JOIN (
|