|
|
@ -390,15 +390,13 @@ RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) |
|
|
h.UserName, |
|
|
h.UserName, |
|
|
dbo.plm_get_user_display(h.Site, h.UserName) AS userDisplay, |
|
|
dbo.plm_get_user_display(h.Site, h.UserName) AS userDisplay, |
|
|
h.NotifyDate, |
|
|
h.NotifyDate, |
|
|
|
|
|
h.EnteredDate, |
|
|
w.workShopName, |
|
|
w.workShopName, |
|
|
o.SOOrderNo as orderNo, |
|
|
o.SOOrderNo as orderNo, |
|
|
o.OpsItemNo as opsItemNo, |
|
|
o.OpsItemNo as opsItemNo, |
|
|
o.SeqNo as seqNo, |
|
|
o.SeqNo as seqNo, |
|
|
m.timeout_reason, |
|
|
m.timeout_reason, |
|
|
CASE |
|
|
|
|
|
when h.confirm_status = '确认' then DATEDIFF(MINUTE, o.needDate, h.confirm_date)/ 60.0 |
|
|
|
|
|
else DATEDIFF(MINUTE, o.needDate, GETDATE())/ 60.0 |
|
|
|
|
|
end as overtimeMinutes |
|
|
|
|
|
|
|
|
calc.overtimeMinutes |
|
|
|
|
|
|
|
|
FROM SOIssueNotifyOrderMaterialList m |
|
|
FROM SOIssueNotifyOrderMaterialList m |
|
|
INNER JOIN SOIssueNotifyOrderList o |
|
|
INNER JOIN SOIssueNotifyOrderList o |
|
|
@ -409,10 +407,18 @@ RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) |
|
|
ON h.UserName = u.username |
|
|
ON h.UserName = u.username |
|
|
LEFT JOIN eam_WorkShop w |
|
|
LEFT JOIN eam_WorkShop w |
|
|
ON u.workShopId = w.workShopId |
|
|
ON u.workShopId = w.workShopId |
|
|
|
|
|
CROSS APPLY ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
CASE |
|
|
|
|
|
when h.confirm_status = '确认' then DATEDIFF(MINUTE, o.needDate, h.confirm_date)/ 60.0 |
|
|
|
|
|
else DATEDIFF(MINUTE, o.needDate, GETDATE())/ 60.0 |
|
|
|
|
|
end as overtimeMinutes |
|
|
|
|
|
) AS calc |
|
|
<where> |
|
|
<where> |
|
|
AND m.Site = #{query.site} |
|
|
AND m.Site = #{query.site} |
|
|
AND ISNULL(m.QtyToIssue_Original,0) < ISNULL(m.QtyToIssue,0) |
|
|
AND ISNULL(m.QtyToIssue_Original,0) < ISNULL(m.QtyToIssue,0) |
|
|
AND DATEDIFF(MINUTE, o.needDate, GETDATE()) > 0 |
|
|
AND DATEDIFF(MINUTE, o.needDate, GETDATE()) > 0 |
|
|
|
|
|
AND calc.overtimeMinutes > 0 |
|
|
|
|
|
|
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
AND m.NotifyNo = #{query.notifyNo} |
|
|
AND m.NotifyNo = #{query.notifyNo} |
|
|
@ -468,6 +474,19 @@ RecordVersion,OutWorkOrderFlag,ProjectID,OrderType,AuthRuleID,bu) |
|
|
AND w.WorkShopId in ('WS005','WS006') |
|
|
AND w.WorkShopId in ('WS005','WS006') |
|
|
</otherwise> |
|
|
</otherwise> |
|
|
</choose> |
|
|
</choose> |
|
|
|
|
|
<if test="query.timeoutReasons != null and query.timeoutReasons.size > 0"> |
|
|
|
|
|
AND ( |
|
|
|
|
|
m.timeout_reason IN ( |
|
|
|
|
|
<foreach collection="query.timeoutReasons" item="item" separator=","> |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
) |
|
|
|
|
|
<if test="'isemtpy' in query.timeoutReasons"> |
|
|
|
|
|
OR LTRIM(RTRIM(m.timeout_reason)) = '' |
|
|
|
|
|
OR m.timeout_reason IS NULL |
|
|
|
|
|
</if> |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
ORDER BY m.NotifyNo, o.needDate, m.ItemNo |
|
|
ORDER BY m.NotifyNo, o.needDate, m.ItemNo |
|
|
</select> |
|
|
</select> |
|
|
|