赫艾后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
12 KiB

4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.heai.modules.board.dao.BoardMapper">
  4. <select id="getWeekShipmentBoardData" resultType="com.heai.modules.board.entity.ViewKanbanCODelNotifyData">
  5. select PartSpec,NotifyQty,QtyPerBox,WeightperBag,BagsperBox,BoxType,WeightperBox,PlanShipDate,Site,FinishedFlag,Operation_SZ,remark,
  6. Operation_HK,abbreviateName FROM view_KANBAN_CODelNotify
  7. <where>
  8. <if test="startDate != null ">
  9. AND PlanShipDate >= #{startDate}
  10. </if>
  11. <if test="endDate != null ">
  12. AND #{endDate} >= PlanShipDate
  13. </if>
  14. </where>
  15. Order By PlanShipDate
  16. </select>
  17. <select id="productionBlankingBoard" resultType="com.heai.modules.board.entity.ViewKanbanSoHunlianPlanData">
  18. select OrderNo,site,PartNo,PartDescSpec,ComponentPartNo,CompPartDescSpec,SJPH1,SJPH_QtyReq1,SJPH2,SJPH_QtyReq2,QtyRequired,QtyFinished,PlanStartDate,CompOrderNo,
  19. FinishedFlag,erpStatus FROM view_KANBAN_SO_Hunlian_Plan
  20. <where>
  21. <if test="startDate != null ">
  22. AND PlanStartDate >= #{startDate}
  23. </if>
  24. <if test="endDate != null ">
  25. AND #{endDate} >= PlanStartDate
  26. </if>
  27. </where>
  28. Order By PlanStartDate
  29. </select>
  30. <select id="soLiuhuaBoard" resultType="com.heai.modules.board.entity.ViewKanbanSoLiuhuaPlanData">
  31. select OrderNo,site,PartNo,PartDescSpec,QtyRequired,QtyFinished,PlanStartDate,erpStatus,FinishedFlag FROM view_KANBAN_SO_Liuhua_Plan
  32. <where>
  33. <if test="startDate != null ">
  34. AND PlanStartDate >= #{startDate}
  35. </if>
  36. <if test="endDate != null ">
  37. AND #{endDate} >= PlanStartDate
  38. </if>
  39. </where>
  40. Order By PlanStartDate
  41. </select>
  42. <select id="productionBlankingSearch" resultType="com.heai.modules.board.entity.ViewKanbanSoHunlianPlanData" parameterType="com.heai.modules.production.entity.DailyPlanInData">
  43. select OrderNo,site,PartDescSpec,ComponentPartNo,CompPartDescSpec,SJPH1,SJPH_QtyReq1,SJPH2,SJPH_QtyReq2,QtyRequired,QtyFinished,PlanStartDate,CompOrderNo,
  44. FinishedFlag,erpStatus,dispatched_hunlian dispatchedHunlian ,orderNo_hunlian FROM view_KANBAN_SO_Hunlian_Plan
  45. <where>
  46. <if test="sql != null ">
  47. AND #{sql} >= PlanStartDate
  48. </if>
  49. <if test="orderNo != null and orderNo != ''">
  50. AND OrderNo like #{orderNo}
  51. </if>
  52. <if test="partDescSpec != null and partDescSpec != ''">
  53. AND PartDescSpec like #{partDescSpec}
  54. </if>
  55. and dispatched_hunlian='N'
  56. </where>
  57. UNION ALL
  58. SELECT null,site,null,ComponentPartNo,null,null,null,null,null,null,null,null,null,null,null,null,null
  59. FROM view_KANBAN_SO_Hunlian_Plan
  60. GROUP BY site,ComponentPartNo
  61. ORDER BY ComponentPartNo,PlanStartDate desc
  62. </select>
  63. <select id="transFerBoard" resultType="TransFerBoardData" >
  64. SELECT a.transNo ,a.site,b.seqNo,a.TransDate,b.TransQty-b.ConfirmQty as qty ,b.OrderNo ,b.PartNo,c.PartDescription as partDesc,
  65. case when s.E_Levels=0 then '产成品' when s.E_Levels=1 then '半成品' else '混炼胶' end as type
  66. FROM SOOpsTransferHeader a LEFT JOIN SOOpsTransferDetail b on a.TransNo=b.TransNo and a.site=b.Site
  67. LEFT JOIN Part c on b.PartNo=c.PartNo and b.site=c.site
  68. LEFT JOIN ShopOrder s on a.site=s.site and b.orderNo=s.OrderNo
  69. where a.Status='已录入' and s.E_Levels !=2 ORDER BY a.TransDate
  70. </select>
  71. <select id="transFerBoardForHunlian" resultType="TransFerBoardData" >
  72. SELECT a.transNo ,a.site,b.seqNo,a.TransDate,b.TransQty-b.ConfirmQty as qty ,b.OrderNo ,b.PartNo,c.PartDescription as partDesc,
  73. '混炼胶' as type
  74. FROM SOOpsTransferHeader a LEFT JOIN SOOpsTransferDetail b on a.TransNo=b.TransNo and a.site=b.Site
  75. LEFT JOIN Part c on b.PartNo=c.PartNo and b.site=c.site
  76. where a.Status='已录入' and ToTypeFlag='混炼胶入库' ORDER BY a.TransDate
  77. </select>
  78. <select id="SORoutingBoard" resultType="SORoutingData" >
  79. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  80. a.QtyReported,a.QtyApprove, isnull(SOP.TotalFinishedQty,0) lastApproveQty,b.NeedDate as planFinishTime
  81. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  82. where b.E_Levels in (1,0) and (a.itemNo =10 or a.QtyRequired>a.QtyReported)
  83. order by planFinishTime
  84. </select>
  85. <select id="SORoutingBoardForXiuBian" resultType="SORoutingData" >
  86. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  87. 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
  88. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  89. 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)
  90. where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported ) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING'
  91. and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
  92. order by planFinishTime
  93. </select>
  94. <select id="SORoutingBoardForJianYan" resultType="SORoutingData" >
  95. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  96. 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
  97. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  98. 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)
  99. where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT'
  100. and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
  101. order by planFinishTime
  102. </select>
  103. <select id="SORoutingBoardForShuiZhu" resultType="SORoutingData" >
  104. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  105. 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
  106. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  107. 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)
  108. where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT'
  109. and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
  110. order by planFinishTime
  111. </select>
  112. <select id="SORoutingBoardForBaoZhuang" resultType="SORoutingData" >
  113. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  114. 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
  115. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  116. 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)
  117. where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING'
  118. and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0) >a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
  119. order by planFinishTime
  120. </select>
  121. <select id="SeqNoForLiuHua" resultType="SORoutingData" >
  122. SELECT a.site,a.OrderNo,a.seqNo,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  123. a.QtyReported,a.QtyApprove,a.S_ScheduledDate as planStartTime,dbo.Get_OperatorDesc(a.Site,a.operatorId) OperatorDesc,
  124. S_ResourceID ResourceId,S_ShiftNo ShiftNo
  125. from SOScheduledRouting a where a.ClosedFlag='N' and a.scheduleType='日计划派工单'
  126. order By a.S_ScheduledDate,a.seqNo
  127. </select>
  128. <select id="getStockPrintList" resultType="com.heai.modules.production.entity.StockPrintData">
  129. select a.PrintQty,b.TransNo,b.Site,b.WareHouseId,b.BatchNo,b.LocationId,b.PartNo,b.OrderNo,b.TransDate,b.Qty,b.PrintFlag,b.site+'|'+ b.PartNo+'|'+b.WareHouseId+'|'+b.BatchNo+'|'+b.LocationId as seqNo
  130. ,dbo.Get_Part_DescSpec(a.Site,b.PartNo) partDesc,dbo.Get_WareHouseDesc(b.Site,b.WareHouseId) as wareHouseDesc,dbo.Get_Part_UMID(b.Site,b.PartNo) umid
  131. from print_info a left join StockPrint b on a.site=b.site and a.orderref1=b.TransNo where a.status='N' and a.orderref2='库存标签'
  132. </select>
  133. <select id="getStockPrintListHunlian" resultType="com.heai.modules.production.entity.StockPrintData">
  134. select a.PrintQty,b.TransNo,b.Site,b.WareHouseId,b.BatchNo,b.LocationId,b.PartNo,b.OrderNo,b.TransDate,b.Qty,b.PrintFlag,b.site+'|'+ b.PartNo+'|'+b.WareHouseId+'|'+b.BatchNo+'|'+b.LocationId as seqNo
  135. ,dbo.Get_Part_DescSpec(a.Site,b.PartNo) partDesc,dbo.Get_WareHouseDesc(b.Site,b.WareHouseId) as wareHouseDesc,dbo.Get_Part_UMID(b.Site,b.PartNo) umid
  136. from print_info a left join StockPrint b on a.site=b.site and a.orderref1=b.TransNo where a.status='N' and a.orderref2='混炼库存标签'
  137. </select>
  138. <select id="PODetailForW" resultType="POBoardData">
  139. Select Convert(float(8),T.ReceiptNo) as ReceiptNo,D.ItemNo,T.ReceiveDate,T.EnterDate,T.SupplierID,T.Receiver,T.Username,
  140. T.DeliveryNoteNo,T.Remark,T.WarehouseID,s.SupplierName,W.WarehouseName,T.Site,D.PartNo,P.PartDescription,P.Spec,P.UMid,
  141. D.ArriveQty,D.POUmID,D.ConvertFactor,D.Status,D.QtytoInspect,D.QtyInspected,D.QtyApproved,D.QtyReturned,D.QtyReplace,
  142. D.QtyScrapt,D.QtyToReceived,D.QtyReceived,D.LocationID,D.OrderNo,D.OrderItemNo,D.NeedInspectFlag,D.SampleInspectionLevelNo,
  143. D.SampleInspectionMethodID,
  144. (Case when D.InspectCode='F' then '全检' when D.InspectCode='Q' then '数量抽检' when D.InspectCode='P' then '比例抽检' when D.InspectCode='V' then '不固定抽检' end) as InspectCode,
  145. D.QtySample,D.PercentSample
  146. from POReceipt as T,POReceiptDetail as D,Warehouse as W,Part as P,Supplier as S where T.Site=D.Site
  147. and T.ReceiptNo=D.ReceiptNo and T.Site=W.Site and T.WareHouseID=W.WareHouseID and D.Site=P.Site and
  148. D.PartNo=P.PartNo and D.NeedInspectFlag='Y' and T.Site=S.Site and T.SupplierID=S.SupplierID and
  149. round(D.ArriveQty,3)>round(D.QtyInspected_New,3) and D.Status!='已取消'
  150. Order by
  151. Convert(float(8),T.ReceiptNo)
  152. </select>
  153. <select id="getSiteData" resultType="com.heai.modules.production.entity.SiteData">
  154. Select * from Site
  155. </select>
  156. </mapper>