Browse Source

修改检验、包装、水煮和修边工序看板sql

master
赵宏斌 5 months ago
parent
commit
578ea37b2d
  1. 19
      src/main/resources/mapper/board/BoardMapper.xml

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

@ -120,12 +120,13 @@
isnull(SOP.QtyApprove,0) lastApproveQty isnull(SOP.QtyApprove,0) lastApproveQty
from SOScheduledRouting T from SOScheduledRouting T
LEFT JOIN SOScheduledRouting SOP ON SOP.site=t.site and SOP.OrderNo=t.OrderNo and SOP.SeqNo = isnull(T.PreviousSeqNo,-1) LEFT JOIN SOScheduledRouting SOP ON SOP.site=t.site and SOP.OrderNo=t.OrderNo and SOP.SeqNo = isnull(T.PreviousSeqNo,-1)
,SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
,SORouting a
left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y' 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 dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING'
and b.status!='已关闭' and b.status!='已取消'
and b.enterDate>'2022-01-01' and b.enterDate>'2022-01-01'
order by T.S_ScheduledDate order by T.S_ScheduledDate
</select> </select>
<select id="SORoutingBoardForJianYan" resultType="SORoutingData" > <select id="SORoutingBoardForJianYan" resultType="SORoutingData" >
SELECT a.site, SELECT a.site,
@ -147,10 +148,10 @@
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) 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)
Left Join PartSubPropertiesValue as S90 On S90.Site=a.Site and S90.PartNo=a.PartNo and S90.PropertiesItemNo='SPECIAL CHECK' Left Join PartSubPropertiesValue as S90 On S90.Site=a.Site and S90.PartNo=a.PartNo and S90.PropertiesItemNo='SPECIAL CHECK'
where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y' where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
and b.status!='已关闭' and b.status!='已取消'
and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT' and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT'
and b.enterDate>'2022-01-01' and b.enterDate>'2022-01-01'
order by T.S_ScheduledDate order by T.S_ScheduledDate
</select> </select>
<select id="SORoutingBoardForShuiZhu" resultType="com.heai.modules.board.entity.SORoutingBoardData" > <select id="SORoutingBoardForShuiZhu" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
SELECT a.site, SELECT a.site,
@ -164,8 +165,8 @@
T.QtyApprove, T.QtyApprove,
isnull(SOP1.QtyApprove,0) lastApproveQty, isnull(SOP1.QtyApprove,0) lastApproveQty,
b.NeedDate as planFinishTime, b.NeedDate as planFinishTime,
'温:' + Convert(varchar(100),isnull(S90.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S91.NumValue,0)) as text1, --工艺备注-水煮
'温:' + Convert(varchar(100),isnull(S92.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S93.NumValue,0)) as text2, --工艺备注-烘烤
'温:' + Convert(varchar(100),isnull(S90.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S91.NumValue,0)) as text1,
'温:' + Convert(varchar(100),isnull(S92.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S93.NumValue,0)) as text2,
p3.TextValue text3 p3.TextValue text3
from SOScheduledRouting T from SOScheduledRouting T
LEFT JOIN SOScheduledRouting SOP1 ON SOP1.site=t.site and SOP1.OrderNo=t.OrderNo and SOP1.SeqNo = isnull(T.PreviousSeqNo,-1) LEFT JOIN SOScheduledRouting SOP1 ON SOP1.site=t.site and SOP1.OrderNo=t.OrderNo and SOP1.SeqNo = isnull(T.PreviousSeqNo,-1)
@ -178,10 +179,10 @@
LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='MATERIAL' LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='MATERIAL'
where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y' where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
and a.partNo like 'FP%' and a.partNo like 'FP%'
and b.status!='已关闭' and b.status!='已取消'
and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT' and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT'
and b.enterDate>'2022-01-01' and b.enterDate>'2022-01-01'
order by T.S_ScheduledDate order by T.S_ScheduledDate
</select> </select>
<select id="SORoutingBoardForBaoZhuang" resultType="com.heai.modules.board.entity.SORoutingBoardData" > <select id="SORoutingBoardForBaoZhuang" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
SELECT a.site, SELECT a.site,
@ -194,7 +195,6 @@
T.QtyReported, T.QtyReported,
T.QtyApprove, T.QtyApprove,
isnull(SOP.QtyApprove,0) lastApproveQty, isnull(SOP.QtyApprove,0) lastApproveQty,
T.S_ScheduledDate as planFinishTime, T.S_ScheduledDate as planFinishTime,
isnull(CONVERT(varchar(30), p1.NumValue),p1.TextValue) text2,p2.NumValue num2,p3.TextValue text1,p4.TextValue text3 isnull(CONVERT(varchar(30), p1.NumValue),p1.TextValue) text2,p2.NumValue num2,p3.TextValue text1,p4.TextValue text3
from SOScheduledRouting T from SOScheduledRouting T
@ -204,13 +204,12 @@
LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY' LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY'
LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON' LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON'
LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE' LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE'
where -- OutWorkFlag代表是否开工
T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
AND a.partNo like 'FP%' AND a.partNo like 'FP%'
and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING' and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING'
and b.status!='已关闭' and b.status!='已取消'
and T.S_ScheduledDate >'2022-01-01' and T.S_ScheduledDate >'2022-01-01'
order by T.S_ScheduledDate order by T.S_ScheduledDate
</select> </select>
<select id="SeqNoForLiuHua" resultType="com.heai.modules.board.entity.SORoutingBoardData" > <select id="SeqNoForLiuHua" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
SELECT a.site,a.OrderNo,a.seqNo,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired, SELECT a.site,a.OrderNo,a.seqNo,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,

Loading…
Cancel
Save