@ -239,13 +239,41 @@
order by a.WorkCenterNo,a.site
order by a.WorkCenterNo,a.site
</select>
</select>
<select id= "getShopOrderRoutingData" resultType= "ShopOrderRoutingData" >
<select id= "getShopOrderRoutingData" resultType= "ShopOrderRoutingData" >
select a.site, a.OrderNo,a.PartNo,a.Status,a.PlanStartDate,a.NeedDate,a.LotSize,a.EnterDate,a.UserName,a.MaterialSplitFlag,a.RepairSOFlag,
P.Spec+'/'+isnull(P.PartDescription,'') PartDescription,P.Spec,isnull(SL.scheduledQty,0) as scheduledQty,s.workCenterNo,S.qtyReported,S.qtyApprove,S.machSetupTime,
S.machRunFactor,S.factorUnit,S.ItemNo,S.OperationDesc,s.Efficiency,isnull(SOP.TotalFinishedQty,0) lastApproveQty,P.NetWeight/1000 weightFactor,
Round(isnull(P.NetWeight/1000,1)*a.LotSize,2) weight,dbo.Get_PartPlanQty(a.site,a.PartNo,a.OrderNo) partPlanQty,cod.PlanShipDate,
dbo.Get_LastStartTime( a.site, a.OrderNo,S.ItemNo) LastStartDate,Round(S.DefectiveQty,3) DefectiveQty,dbo.Get_PartValue( a.site,a.PartNo,'CURING METHOD') cuiHuaJi,
Round((a.LotSize- S.qtyReported)/case when s.MachRunFactor=0 then 1000000 else s.MachRunFactor end ,1) lastTime
,dbo.Get_E_OriginalOrderTypeDesc(a.site, a.OrderNo) orderTypeDesc
select a.site,
a.OrderNo,
a.PartNo,
a.Status,
a.PlanStartDate,
a.NeedDate,
a.LotSize,
a.EnterDate,
a.UserName,
a.MaterialSplitFlag,
a.RepairSOFlag,
P.Spec + '/' + isnull(P.PartDescription, '') PartDescription,
P.Spec,
isnull(SL.scheduledQty, 0) as scheduledQty,
s.workCenterNo,
S.qtyReported,
S.qtyApprove,
S.machSetupTime,
S.machRunFactor,
S.factorUnit,
S.ItemNo,
S.OperationDesc,
s.Efficiency,
isnull(SOP.TotalFinishedQty, 0) lastApproveQty,
P.NetWeight / 1000 weightFactor,
Round(isnull(P.NetWeight / 1000, 1) * a.LotSize, 2) weight,
dbo.Get_PartPlanQty(a.site, a.PartNo, a.OrderNo) partPlanQty,
cod.PlanShipDate,
dbo.Get_LastStartTime(a.site, a.OrderNo, S.ItemNo) LastStartDate,
Round(S.DefectiveQty, 3) DefectiveQty,
dbo.Get_PartValue(a.site, a.PartNo, 'CURING METHOD') cuiHuaJi,
Round((a.LotSize - S.qtyReported) / case when s.MachRunFactor = 0 then 1000000 else s.MachRunFactor end,
1) lastTime
,
dbo.Get_E_OriginalOrderTypeDesc(a.site, a.OrderNo) orderTypeDesc
FROM ShopOrder a
FROM ShopOrder a
LEFT JOIN Part P ON P.PartNo=a.PartNo AND a.site=P.Site
LEFT JOIN Part P ON P.PartNo=a.PartNo AND a.site=P.Site
LEFT JOIN SORouting S on S.site=a.site and S.OrderNo=a.orderNo
LEFT JOIN SORouting S on S.site=a.site and S.OrderNo=a.orderNo
@ -329,7 +357,11 @@
, s.efficiency
, s.efficiency
, so.RepairSOFlag
, so.RepairSOFlag
, dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) orderTypeDesc
, dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) orderTypeDesc
, S.machSetupTime
, S.machRunFactor
, S.factorUnit
, Round((so.LotSize - S.qtyReported) / case when s.MachRunFactor = 0 then 1000000 else s.MachRunFactor end,
1) lastTime
from SOTaskOrderHeader as h
from SOTaskOrderHeader as h
left join ShopOrder as t on h.Site = t.Site and h.OrderRef1 = t.OrderNo ---硫化的订单t
left join ShopOrder as t on h.Site = t.Site and h.OrderRef1 = t.OrderNo ---硫化的订单t
left join ShopOrder as SO on t.site = SO.Site and t.orderNo = SO.Prelev_order_no and
left join ShopOrder as SO on t.site = SO.Site and t.orderNo = SO.Prelev_order_no and
@ -351,7 +383,11 @@
and h.Status !='已取消' and so.PartNo is not null
and h.Status !='已取消' and so.PartNo is not null
<!-- and isnull(SL.scheduledQty,0) =0 -->
<!-- and isnull(SL.scheduledQty,0) =0 -->
and SV.site is null
and SV.site is null
<if test= "startDate1 != null" >
<if test= "startDate1 != null" >
AND h.orderDate >= #{startDate1}
AND h.orderDate >= #{startDate1}
</if>
</if>
<if test= "endDate1 != null" >
<if test= "endDate1 != null" >
@ -364,7 +400,8 @@
AND SO.OrderNo LIKE #{orderNo}
AND SO.OrderNo LIKE #{orderNo}
</if>
</if>
<if test= "partDescription != null and partDescription != ''" >
<if test= "partDescription != null and partDescription != ''" >
AND isnull(P.spec, '') +'/'+P.PartDescription LIKE #{partDescription}
AND isnull(P.spec
, '') +'/'+P.PartDescription LIKE #{partDescription}
</if>
</if>
<if test= "partNo != null and partNo != ''" >
<if test= "partNo != null and partNo != ''" >
AND SO.PartNo LIKE #{partNo}
AND SO.PartNo LIKE #{partNo}