Browse Source

修改修边工序看板sql

master
赵宏斌 5 months ago
parent
commit
df5b6b1370
  1. 25
      src/main/resources/mapper/board/BoardMapper.xml

25
src/main/resources/mapper/board/BoardMapper.xml

@ -107,13 +107,24 @@
</select>
<select id="SORoutingBoardForXiuBian" resultType="SORoutingData" >
SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,a.QtyRequired,dbo.Get_PartRemark(a.Site,a.PartNo) as remark,
a.QtyReported,a.QtyApprove,isnull(SOP.TotalFinishedQty,0) lastApproveQty,b.NeedDate as planFinishTime,dbo.Get_SORouting_ClosedFlag(a.site,a.OrderNo,a.ItemNo) as ClosedFlag
from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
LEFT JOIN SORoutingOutput SOP ON a.site=SOP.site and a.OrderNo=SOP.OrderNo and SOP.itemNo=dbo.Get_SORouting_PreviousOperationItemNo(a.site,a.OrderNo,a.itemNo)
where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported ) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING'
and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
order by planFinishTime
SELECT a.site,
a.OrderNo,
T.SeqNo,
a.OperationDesc,
a.PartNo,
dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
dbo.Get_PartRemark(a.Site,a.PartNo) as remark,
T.QtyRequired,
T.QtyReported,
T.QtyApprove,
isnull(SOP.TotalFinishedQty,0) lastApproveQty
from SOScheduledRouting T
,SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
LEFT JOIN SORoutingOutput SOP ON a.site=SOP.site and a.OrderNo=SOP.OrderNo and SOP.itemNo=dbo.Get_SORouting_PreviousOperationItemNo(a.site,a.OrderNo,a.itemNo)
where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING'
and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
order by T.S_ScheduledDate
</select>
<select id="SORoutingBoardForJianYan" resultType="SORoutingData" >

Loading…
Cancel
Save