@ -130,15 +130,65 @@
<!-- </select> -->
<!-- </select> -->
<select id= "searchProductionLineOutputReport" resultType= "com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData" >
<select id= "searchProductionLineOutputReport" resultType= "com.gaotao.modules.shopOrder.entity.SearchProductionLineOutputReportData" >
Select T.Site,T.OrderNo,T.ItemNo,T.SeqNo,T.ReportDate,T.OperatorID,T.Direction,T.ReportQty,T.ApproveQty,Round(T.ReportedSetupTime,2) as reportedSetupTime,R.WorkcenterNo,W.WorkCenterDesc,O.OperatorName
,Round(T.ReportedManfTime,2) as reportedManfTime,T.ReportedCleanupTime,T.ScrapReason,T.DownTimeReason,T.Reverseflag,T.RelevantSeqNo,T.Remark
,T.starttime,T.finishtime,T.downtime,T.AssJobSeqNo,(T.ReportQty - T.ApproveQty) as DefectQty
,R.OperationDesc,SS.QtyRequired,SS.S_ResourceID,T.RollNo,T.Scheduled_ShiftNo,T.Scheduled_Date,T.FirstReportFlag,T.ReportedSetupDowntime ,T.ReportedManfDowntime
,S.PartNo,p.PartDescription+' / '+p.Spec as PartDescription,P.ConfigurationTemplateID as CustomerName,
P.Remark as CustPartNo,Round((case when T.ReportedManfTime=0 then 999999 else T.ApproveQty / T.ReportedManfTime end),2) as ActRunRate,s.NeedDate
from SFDC as T
left join SOScheduledRouting as SS on T.Site=SS.Site and T.OrderNo=SS.OrderNo and T.ItemNo=SS.ItemNo and T.AssJobSeqNo=SS.SeqNo
,ShopOrder as S,SORouting as R,Part as P,WorkCenter as W,Operator as O
SELECT
T.Site,
T.OrderNo,
T.ItemNo,
T.SeqNo,
T.ReportDate,
T.OperatorID,
T.Direction,
T.ReportQty,
T.ApproveQty,
Round(T.ReportedSetupTime, 2) AS reportedSetupTime,
R.WorkcenterNo,
W.WorkCenterDesc,
O.OperatorName,
Round(T.ReportedManfTime, 2) AS reportedManfTime,
T.ReportedCleanupTime,
T.ScrapReason,
T.DownTimeReason,
T.Reverseflag,
T.RelevantSeqNo,
T.Remark,
T.starttime,
T.finishtime,
T.downtime,
T.AssJobSeqNo,
(T.ReportQty - T.ApproveQty) AS DefectQty,
R.OperationDesc,
SS.QtyRequired,
SS.S_ResourceID,
T.RollNo,
T.Scheduled_ShiftNo,
T.Scheduled_Date,
T.FirstReportFlag,
T.ReportedSetupDowntime,
T.ReportedManfDowntime,
S.PartNo,
p.PartDescription AS PartDescription,
p.Spec as spec,
P.ConfigurationTemplateID AS CustomerName,
P.Remark AS CustPartNo,
Round(
(
CASE
WHEN T.ReportedManfTime = 0 THEN
999999
ELSE
T.ApproveQty / T.ReportedManfTime
END
),
2
) AS ActRunRate,
s.NeedDate
FROM SFDC AS T
LEFT JOIN SOScheduledRouting AS SS ON T.Site = SS.Site AND T.OrderNo = SS.OrderNo AND T.ItemNo = SS.ItemNo AND T.AssJobSeqNo = SS.SeqNo,
ShopOrder AS S,
SORouting AS R,
Part AS P,
WorkCenter AS W,
Operator AS O
<where >
<where >
and T.Site = S.Site and T.OrderNo = S.OrderNo and T.Site = R.Site and T.OrderNo = R.OrderNo and T.ItemNo = R.ItemNo and s.Site = p.Site
and T.Site = S.Site and T.OrderNo = S.OrderNo and T.Site = R.Site and T.OrderNo = R.OrderNo and T.ItemNo = R.ItemNo and s.Site = p.Site
and s.PartNo = p.PartNo and R.Site = W.Site and R.WorkCenterNo = W.WorkCenterNo and T.Site = O.Site and T.OperatorID = O.OperatorID
and s.PartNo = p.PartNo and R.Site = W.Site and R.WorkCenterNo = W.WorkCenterNo and T.Site = O.Site and T.OperatorID = O.OperatorID
@ -152,10 +202,13 @@
AND s.PartNo like '%' + #{partNo} + '%'
AND s.PartNo like '%' + #{partNo} + '%'
</if>
</if>
<if test= " partDescription != null and partDescription != ''" >
<if test= " partDescription != null and partDescription != ''" >
AND p.PartDescription+' / '+p.Spec like '%' + #{partDescription} + '%'
AND p.PartDescription like '%' + #{partDescription} + '%'
</if>
<if test= " spec != null and spec != ''" >
AND p.Spec like '%' + #{spec} + '%'
</if>
</if>
<if test= " orderNo != null and orderNo != ''" >
<if test= " orderNo != null and orderNo != ''" >
AND T.OrderNo = #{orderNo}
AND T.OrderNo like '%' + #{orderNo} + '%'
</if>
</if>
<if test= " operatorID != null and operatorID != ''" >
<if test= " operatorID != null and operatorID != ''" >
AND T.OperatorID like '%' + #{operatorID} + '%'
AND T.OperatorID like '%' + #{operatorID} + '%'
@ -163,6 +216,9 @@
<if test= " workCenterNo != null and workCenterNo != ''" >
<if test= " workCenterNo != null and workCenterNo != ''" >
AND R.WorkcenterNo like '%' + #{workCenterNo} + '%'
AND R.WorkcenterNo like '%' + #{workCenterNo} + '%'
</if>
</if>
<if test= " workCenterDesc != null and workCenterDesc != ''" >
AND W.WorkCenterDesc like '%' + #{workCenterDesc} + '%'
</if>
<if test= " sResourceID != null and sResourceID != ''" >
<if test= " sResourceID != null and sResourceID != ''" >
AND SS.S_ResourceID like '%' + #{sResourceID} + '%'
AND SS.S_ResourceID like '%' + #{sResourceID} + '%'
</if>
</if>