赫艾后端
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.

500 lines
30 KiB

5 years ago
​
​
​
​
3 years ago
​
5 years ago
​
​
​
​
​
​
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
​
​
5 years ago
5 years ago
5 years ago
​
​
​
​
​
​
​
​
4 years ago
5 years ago
5 years ago
​
​
​
​
​
​
​
​
​
4 years ago
5 years ago
​
​
​
​
5 years ago
2 years ago
​
​
4 years ago
5 years ago
5 years ago
​
5 years ago
5 years ago
​
​
​
3 years ago
​
​
5 years ago
4 years ago
5 years ago
5 years ago
4 years ago
4 years ago
​
​
​
​
5 years ago
​
4 years ago
4 years ago
3 years ago
​
4 years ago
​
​
3 years ago
4 years ago
​
​
​
4 years ago
4 years ago
​
4 years ago
4 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
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
3 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
​
​
​
​
3 years ago
4 years ago
3 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
4 years ago
2 years ago
​
​
​
​
4 years ago
3 years ago
4 years ago
4 years ago
2 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
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
4 years ago
4 years ago
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
4 years ago
4 years ago
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
3 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
3 years ago
​
​
​
3 years ago
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 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 abbreviateName,CustomerPONo,DelNotifyNo,PlanShipDate,PartSpec,NotifyQty,forwarderName,EnteredDate,Remark,round(isnull(dbo.Get_PartTotalStock(site,partNo),0),2) stock ,finishedFlag from (
  6. select abbreviateName,CustomerPONo,DelNotifyNo,PlanShipDate,PartSpec,NotifyQty,forwarderName,EnteredDate,Remark,site,partNo,finishedFlag from view_KANBAN_CODelNotify_new
  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. ) a
  16. Order By PlanShipDate
  17. </select>
  18. <select id="productionBlankingBoard" resultType="com.heai.modules.board.entity.ViewKanbanSoHunlianPlanData">
  19. select OrderNo,site,PartNo,PartDescSpec,ComponentPartNo,CompPartDescSpec,SJPH1,SJPH_QtyReq1,SJPH2,SJPH_QtyReq2,QtyRequired,QtyFinished,PlanStartDate,CompOrderNo,
  20. FinishedFlag,erpStatus FROM view_KANBAN_SO_Hunlian_Plan
  21. <where>
  22. <if test="startDate != null ">
  23. AND PlanStartDate >= #{startDate}
  24. </if>
  25. <if test="endDate != null ">
  26. AND #{endDate} >= PlanStartDate
  27. </if>
  28. </where>
  29. Order By PlanStartDate
  30. </select>
  31. <select id="soLiuhuaBoard" resultType="com.heai.modules.board.entity.ViewKanbanSoLiuhuaPlanData">
  32. select OrderNo,site,PartNo,PartDescSpec,QtyRequired,QtyFinished,PlanStartDate,erpStatus,FinishedFlag FROM view_KANBAN_SO_Liuhua_Plan
  33. <where>
  34. <if test="startDate != null ">
  35. AND PlanStartDate >= #{startDate}
  36. </if>
  37. <if test="endDate != null ">
  38. AND #{endDate} >= PlanStartDate
  39. </if>
  40. </where>
  41. Order By PlanStartDate
  42. </select>
  43. <select id="productionBlankingSearch" resultType="com.heai.modules.board.entity.ViewKanbanSoHunlianPlanData" parameterType="com.heai.modules.production.entity.DailyPlanInData">
  44. select OrderNo,site,PartDescSpec,ComponentPartNo,CompPartDescSpec,partNo1,SJPH1,dbo.Get_PartQtyOnHand(site,partNo1) as inventory1,SJPH_QtyReq1,partNo2,SJPH2,dbo.Get_PartQtyOnHand(site,partNo2) as inventory2,SJPH_QtyReq2,QtyRequired,QtyFinished,PlanStartDate,CompOrderNo,
  45. FinishedFlag,erpStatus,dispatched_hunlian dispatchedHunlian ,orderNo_hunlian ,dbo.Get_E_OriginalOrderTypeDesc(site, OrderNo) orderTypeDesc
  46. FROM view_KANBAN_SO_Hunlian_Plan
  47. <where>
  48. <if test="sql != null ">
  49. AND #{sql} >= PlanStartDate
  50. </if>
  51. <if test="orderNo != null and orderNo != ''">
  52. AND OrderNo like #{orderNo}
  53. </if>
  54. <if test="partDescSpec != null and partDescSpec != ''">
  55. AND PartDescSpec like #{partDescSpec}
  56. </if>
  57. <if test="soTaskNo != null and soTaskNo != ''">
  58. AND orderNo_hunlian like #{soTaskNo}
  59. </if>
  60. and dispatched_hunlian='N'
  61. </where>
  62. UNION ALL
  63. SELECT null,site,null,ComponentPartNo,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
  64. FROM view_KANBAN_SO_Hunlian_Plan
  65. GROUP BY site,ComponentPartNo
  66. ORDER BY ComponentPartNo,PlanStartDate desc
  67. </select>
  68. <select id="transFerBoard" resultType="TransFerBoardData" >
  69. SELECT a.transNo ,a.site,b.seqNo,a.TransDate,b.TransQty-b.ConfirmQty as qty ,b.OrderNo ,b.PartNo,c.spec+'|'+isnull(c.PartDescription,'') as partDesc,
  70. case when b.PartNo like 'FP%' then '产成品' else '半成品' end as type
  71. ,a.NeedReceiveFlag
  72. FROM SOOpsTransferHeader a LEFT JOIN SOOpsTransferDetail b on a.TransNo=b.TransNo and a.site=b.Site
  73. LEFT JOIN Part c on b.PartNo=c.PartNo and b.site=c.site
  74. LEFT JOIN ShopOrder s on a.site=s.site and b.orderNo=s.OrderNo
  75. where a.Status='已录入' and b.PartNo not like 'RC%' and b.PartNo not like 'SC%' and ToTypeFlag_db!='I' ORDER BY a.TransDate
  76. </select>
  77. <select id="transFerBoardForHunlian" resultType="TransFerBoardData" >
  78. SELECT a.transNo ,a.site,b.seqNo,a.TransDate,b.TransQty-b.ConfirmQty as qty ,b.OrderNo ,b.PartNo,c.PartDescription as partDesc,
  79. '混炼胶' as type ,a.NeedReceiveFlag
  80. FROM SOOpsTransferHeader a LEFT JOIN SOOpsTransferDetail b on a.TransNo=b.TransNo and a.site=b.Site
  81. LEFT JOIN Part c on b.PartNo=c.PartNo and b.site=c.site
  82. where a.Status='已录入' and ToTypeFlag='混炼胶入库' and ToTypeFlag_db!='I' ORDER BY a.TransDate
  83. </select>
  84. <select id="SORoutingBoard" resultType="SORoutingData" >
  85. SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  86. a.QtyReported,a.QtyApprove, isnull(SOP.TotalFinishedQty,0) lastApproveQty,b.NeedDate as planFinishTime
  87. from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  88. where b.PartNo not like 'RC%' and b.PartNo not like 'SC%' and (a.itemNo =10 or a.QtyRequired>a.QtyReported)
  89. order by planFinishTime
  90. </select>
  91. <select id="SORoutingBoardForXiuBian" resultType="SORoutingData" >
  92. SELECT a.site,
  93. a.OrderNo,
  94. T.SeqNo,
  95. a.OperationDesc,
  96. a.PartNo,
  97. dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
  98. dbo.Get_PartRemark(a.Site,a.PartNo) as remark,
  99. T.QtyRequired,
  100. T.QtyReported,
  101. T.QtyApprove,
  102. isnull(SOP.QtyApprove,0) lastApproveQty,
  103. T.OutWorkFlag as ClosedFlag
  104. from SOScheduledRouting T
  105. LEFT JOIN SOScheduledRouting SOP ON SOP.site=t.site and SOP.OrderNo=t.OrderNo and SOP.SeqNo = isnull(T.PreviousSeqNo,-1)
  106. ,SORouting a
  107. left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  108. where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND (T.OutWorkFlag = 'N' OR t.S_ScheduledDate=cast(GetDate() as Date) )
  109. and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING'
  110. and b.status!='已关闭' and b.status!='已取消'
  111. and b.enterDate>'2022-01-01'
  112. order by T.S_ScheduledDate
  113. </select>
  114. <select id="SORoutingBoardForJianYan" resultType="SORoutingData" >
  115. SELECT a.site,
  116. a.OrderNo,
  117. T.SeqNo,
  118. a.OperationDesc,
  119. a.PartNo,
  120. dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
  121. T.QtyRequired,
  122. T.QtyReported,
  123. T.QtyApprove,
  124. isnull(SOP1.QtyApprove,0) lastApproveQty,
  125. b.NeedDate as planFinishTime,
  126. S90.TextValue as remark,
  127. T.OutWorkFlag as ClosedFlag
  128. from SOScheduledRouting T
  129. LEFT JOIN SOScheduledRouting SOP1 ON SOP1.site=t.site and SOP1.OrderNo=t.OrderNo and SOP1.SeqNo = isnull(T.PreviousSeqNo,-1)
  130. ,SORouting a
  131. left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  132. 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)
  133. Left Join PartSubPropertiesValue as S90 On S90.Site=a.Site and S90.PartNo=a.PartNo and S90.PropertiesItemNo='SPECIAL CHECK'
  134. where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND (T.OutWorkFlag = 'N' OR t.S_ScheduledDate=cast(GetDate() as Date) )
  135. and b.status!='已关闭' and b.status!='已取消'
  136. and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT'
  137. and b.enterDate>'2022-01-01'
  138. order by T.S_ScheduledDate
  139. </select>
  140. <select id="SORoutingBoardForShuiZhu" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
  141. SELECT a.site,
  142. a.OrderNo,
  143. T.SeqNo,
  144. a.OperationDesc,
  145. a.PartNo,
  146. dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
  147. T.QtyRequired,
  148. T.QtyReported,
  149. T.QtyApprove,
  150. isnull(SOP1.QtyApprove,0) lastApproveQty,
  151. b.NeedDate as planFinishTime,
  152. '温:' + Convert(varchar(100),isnull(S90.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S91.NumValue,0)) as text1,
  153. '温:' + Convert(varchar(100),isnull(S92.NumValue,0)) + ' ' + '时:' + Convert(varchar(100),isnull(S93.NumValue,0)) as text2,
  154. p3.TextValue text3,
  155. T.OutWorkFlag as ClosedFlag
  156. from SOScheduledRouting T
  157. LEFT JOIN SOScheduledRouting SOP1 ON SOP1.site=t.site and SOP1.OrderNo=t.OrderNo and SOP1.SeqNo = isnull(T.PreviousSeqNo,-1)
  158. ,SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  159. 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)
  160. Left Join PartSubPropertiesValue as S90 On S90.Site=a.Site and S90.PartNo=a.PartNo and S90.RecordType='P' and S90.SubCodeSeqNo=1 and S90.PropertiesItemNo='WATER TEMP'
  161. Left Join PartSubPropertiesValue as S91 On S91.Site=a.Site and S91.PartNo=a.PartNo and S91.RecordType='P' and S91.SubCodeSeqNo=1 and S91.PropertiesItemNo='WATER TIME'
  162. Left Join PartSubPropertiesValue as S92 On S92.Site=a.Site and S92.PartNo=a.PartNo and S92.RecordType='P' and S92.SubCodeSeqNo=1 and S92.PropertiesItemNo='POST CURE-TEMP'
  163. Left Join PartSubPropertiesValue as S93 On S93.Site=a.Site and S93.PartNo=a.PartNo and S93.RecordType='P' and S93.SubCodeSeqNo=1 and S93.PropertiesItemNo='POST CURE-TIME'
  164. LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='MATERIAL'
  165. where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND (T.OutWorkFlag = 'N' OR t.S_ScheduledDate=cast(GetDate() as Date) )
  166. and a.partNo like 'FP%'
  167. and b.status!='已关闭' and b.status!='已取消'
  168. and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT'
  169. and b.enterDate>'2022-01-01'
  170. order by T.S_ScheduledDate
  171. </select>
  172. <select id="SORoutingBoardForBaoZhuang" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
  173. SELECT a.site,
  174. a.OrderNo,
  175. T.SeqNo,
  176. a.OperationDesc,
  177. a.PartNo,
  178. dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
  179. T.QtyRequired,
  180. T.QtyReported,
  181. T.QtyApprove,
  182. isnull(SOP.QtyApprove,0) lastApproveQty,
  183. T.S_ScheduledDate as planFinishTime,
  184. isnull(CONVERT(varchar(30), p1.NumValue),p1.TextValue) text2,p2.NumValue num2,p3.TextValue text1,p4.TextValue text3,
  185. T.OutWorkFlag as ClosedFlag
  186. from SOScheduledRouting T
  187. LEFT JOIN SOScheduledRouting SOP ON SOP.site=t.site and SOP.OrderNo=t.OrderNo and SOP.SeqNo = isnull(T.PreviousSeqNo,-1)
  188. ,SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
  189. LEFT JOIN PartSubPropertiesValue p1 on p1.site=a.site and p1.PartNo=a.PartNo and p1.PropertiesItemNo='BAG'
  190. LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY'
  191. LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON'
  192. LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE'
  193. where T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND (T.OutWorkFlag = 'N' OR t.S_ScheduledDate=cast(GetDate() as Date) )
  194. AND a.partNo like 'FP%'
  195. and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING'
  196. and b.status!='已关闭' and b.status!='已取消'
  197. and T.S_ScheduledDate >'2022-01-01'
  198. order by T.S_ScheduledDate
  199. </select>
  200. <select id="SeqNoForLiuHua" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
  201. SELECT a.site,a.OrderNo,a.seqNo,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  202. a.QtyReported,a.QtyApprove,a.S_ScheduledDate as planStartTime,dbo.Get_OperatorDesc(a.Site,a.operatorId) OperatorDesc,
  203. a.S_ResourceID ResourceId,a.S_ShiftNo ShiftNo,a.OutWorkFlag
  204. ,P1.TextValue text1,Round(p2.NumValue*a.QtyRequired/1000,2) num1,P3.TextValue text2,p4.TextValue text3
  205. from SOScheduledRouting a left join ShopOrder b on a.site=b.site and a.OrderNo=b.OrderNo
  206. LEFT JOIN PartSubPropertiesValue p1 on p1.site=a.site and p1.PartNo=a.PartNo and p1.PropertiesItemNo='MATERIAL TYPE'
  207. LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='GROSS WEIGHT'
  208. LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='DUROA'
  209. LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='COLOR'
  210. where a.ClosedFlag='N' and a.scheduleType='日计划派工单' and dbo.Get_WorkCenter_ProLineNo(a.site,a.S_WorkCenterNo)!='EXTRUSIO' and b.status!='已关闭' and b.status!='已取消'
  211. order By a.S_ScheduledDate,a.seqNo
  212. </select>
  213. <select id="SeqNoForLiuHuaJiChu" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
  214. SELECT a.site,a.OrderNo,a.seqNo,a.PartNo,dbo.Get_PartDesc(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
  215. a.QtyReported,a.QtyApprove,a.S_ScheduledDate as planStartTime,dbo.Get_OperatorDesc(a.Site,a.operatorId) OperatorDesc,
  216. a.S_ResourceID ResourceId,a.S_ShiftNo ShiftNo
  217. ,P1.NumValue num1,P2.NumValue num2,P3.NumValue num3,P4.NumValue num4,P5.NumValue num5,P6.NumValue num6,
  218. P7.NumValue num7,P8.NumValue num8,P9.NumValue num9,a.OutWorkFlag
  219. from SOScheduledRouting a left join ShopOrder b on a.site=b.site and a.OrderNo=b.OrderNo
  220. LEFT JOIN PartSubPropertiesValue p1 on p1.site=a.site and p1.PartNo=a.PartNo and p1.CodeNo='EXTRUSION' and p1.PropertiesItemNo='CHANNEL 1'
  221. LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.CodeNo='EXTRUSION' and p2.PropertiesItemNo='CHANNEL 2'
  222. LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.CodeNo='EXTRUSION' and p3.PropertiesItemNo='CHANNEL 3'
  223. LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.CodeNo='EXTRUSION' and p4.PropertiesItemNo='CHANNEL 4'
  224. LEFT JOIN PartSubPropertiesValue p5 on p5.site=a.site and p5.PartNo=a.PartNo and p5.CodeNo='EXTRUSION' and p5.PropertiesItemNo='CHANNEL 5'
  225. LEFT JOIN PartSubPropertiesValue p6 on p6.site=a.site and p6.PartNo=a.PartNo and p6.CodeNo='EXTRUSION' and p6.PropertiesItemNo='HEAT HEAD'
  226. LEFT JOIN PartSubPropertiesValue p7 on p7.site=a.site and p7.PartNo=a.PartNo and p7.CodeNo='EXTRUSION' and p7.PropertiesItemNo='HEAD SPEED'
  227. LEFT JOIN PartSubPropertiesValue p8 on p8.site=a.site and p8.PartNo=a.PartNo and p8.CodeNo='EXTRUSION' and p8.PropertiesItemNo='TUNNEL SPEED'
  228. LEFT JOIN PartSubPropertiesValue p9 on p9.site=a.site and p9.PartNo=a.PartNo and p9.CodeNo='EXTRUSION' and p9.PropertiesItemNo='EXTRUSION POWER'
  229. where a.ClosedFlag='N' and a.scheduleType='日计划派工单' and dbo.Get_WorkCenter_ProLineNo(a.site,a.S_WorkCenterNo)='EXTRUSIO' and b.status!='已关闭' and b.status!='已取消'
  230. order By a.S_ScheduledDate,a.seqNo
  231. </select>
  232. <select id="getStockPrintList" resultType="com.heai.modules.production.entity.StockPrintData">
  233. 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,Round(dbo.Get_Part_NetWeight(b.Site,b.PartNo)*b.Qty/1000,2) weight
  234. ,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,dbo.get_expiredDate_print(b.Site,b.PartNo,b.BatchNo) expiredDate
  235. 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='库存标签'
  236. </select>
  237. <select id="getStockPrintListForReturn" resultType="com.heai.modules.production.entity.StockPrintData">
  238. 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,Round(dbo.Get_Part_NetWeight(b.Site,b.PartNo)*b.Qty/1000,2) weight
  239. ,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,dbo.get_expiredDate_print(b.Site,b.PartNo,b.BatchNo) expiredDate
  240. 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='退料标签'
  241. </select>
  242. <select id="getStockPrintListHunlian" resultType="com.heai.modules.production.entity.StockPrintData">
  243. 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,Round(dbo.Get_Part_NetWeight(b.Site,b.PartNo)*b.Qty/1000,2) weight
  244. ,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,dbo.get_expiredDate_print(b.Site,b.PartNo,b.BatchNo) expiredDate
  245. 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='混炼库存标签'
  246. </select>
  247. <select id="getStockPrintListHunlianReturn" resultType="com.heai.modules.production.entity.StockPrintData">
  248. 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,Round(dbo.Get_Part_NetWeight(b.Site,b.PartNo)*b.Qty/1000,2) weight
  249. ,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,dbo.get_expiredDate_print(b.Site,b.PartNo,b.BatchNo) expiredDate
  250. 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='混炼退料标签'
  251. </select>
  252. <select id="getStockPrintListCaiGou" resultType="com.heai.modules.production.entity.StockPrintData">
  253. Select D.TransNo,D.ItemNo,D.PartNo,dbo.Get_Part_DescSpec(D.Site,D.PartNo) as partDesc,dbo.Get_Part_UMID(D.Site,D.PartNo) as UMid
  254. ,D.Remark,D.OrderRef4 orderNo,T.EnterDate as TransDate,D.transQty qty,T.WarehouseID wareHouseId
  255. ,D.Site ,D.BatchNo,D.LocationID LocationId,D.site+'|'+ D.PartNo+'|'+T.WareHouseId+'|'+D.BatchNo+'|'+D.LocationId as seqNo
  256. ,dbo.Get_WareHouseDesc(T.Site,T.WarehouseID) as wareHouseDesc, dbo.get_expiredDate_print(D.Site,D.PartNo,D.BatchNo) ExpiredDate,p.id,p.printQty
  257. ,dbo.Get_StorePrintPartStatus(D.Site,D.PartNo,D.BatchNo) status,Round(dbo.Get_Part_NetWeight(D.Site,D.PartNo)*D.transQty/1000,2) weight
  258. from TransDetail as D,TransHeader as t,print_info p
  259. Where T.Site=D.Site and T.TransNo=D.TransNo
  260. and D.Site=p.site and D.TransNo=p.orderref1
  261. and D.ItemNo=p.orderref2 and p.status != 'Y' and p.LabelType='库存标签' and p.ComputerName =#{ip}
  262. </select>
  263. <select id="PODetailForW" resultType="POBoardData">
  264. Select Convert(float(8),T.ReceiptNo) as ReceiptNo,D.ItemNo,T.ReceiveDate,T.EnterDate,T.SupplierID,T.Receiver,T.Username,
  265. T.DeliveryNoteNo,T.Remark,T.WarehouseID,s.SupplierName,W.WarehouseName,T.Site,D.PartNo,P.PartDescription,P.Spec,P.UMid,
  266. D.ArriveQty,D.POUmID,D.ConvertFactor,D.Status,D.QtytoInspect,D.QtyInspected,D.QtyApproved,D.QtyReturned,D.QtyReplace,
  267. D.QtyScrapt,D.QtyToReceived,D.QtyReceived,D.LocationID,D.OrderNo,D.OrderItemNo,D.NeedInspectFlag,D.SampleInspectionLevelNo,
  268. D.SampleInspectionMethodID,
  269. (Case when D.InspectCode='F' then '全检' when D.InspectCode='Q' then '数量抽检' when D.InspectCode='P' then '比例抽检' when D.InspectCode='V' then '不固定抽检' end) as InspectCode,
  270. D.QtySample,D.PercentSample
  271. from POReceipt as T,POReceiptDetail as D,Warehouse as W,Part as P,Supplier as S where T.Site=D.Site
  272. and T.ReceiptNo=D.ReceiptNo and T.Site=W.Site and T.WareHouseID=W.WareHouseID and D.Site=P.Site and
  273. D.PartNo=P.PartNo and D.NeedInspectFlag='Y' and T.Site=S.Site and T.SupplierID=S.SupplierID and
  274. round(D.ArriveQty,3)>round(D.QtyInspected_New,3) and D.Status!='已取消'
  275. Order by
  276. Convert(float(8),T.ReceiptNo)
  277. </select>
  278. <select id="getSiteData" resultType="com.heai.modules.production.entity.SiteData">
  279. Select * from Site
  280. </select>
  281. <update id="updatePrintFlag" >
  282. update print_info set status = #{flag} where id=#{id}
  283. </update>
  284. <select id="getStockPrintOutBox" resultType="com.heai.modules.production.entity.PrintInfoData">
  285. select id,batch_no,printer_name,status,orderref1,orderref2,remark,site,created_by,created_date,orderref3,printQty,ComputerName,
  286. LabelType,UnitQty,KeyInfo_Int1,KeyInfo_Int2,KeyInfo_Str1,KeyInfo_Str2,KeyInfo_Float1,KeyInfo_Float2,SUBSTRING(LabelType, 5, 10) code from print_info
  287. where status!='Y' and LabelType like '箱标签%' and ComputerName=#{ip}
  288. </select>
  289. <select id="checkPrintData" resultType="com.heai.modules.production.entity.PrintInfoData">
  290. select id from print_info where status!='Y' and LabelType like #{type}+'%' and ComputerName=#{ip}
  291. </select>
  292. <select id="checkCaigouPrintData" resultType="com.heai.modules.production.entity.PrintInfoData">
  293. select id from print_info where status!='Y' and LabelType like #{type}+'%' and ComputerName=#{ip}
  294. </select>
  295. <select id="getSiteDetail" resultType="String">
  296. select REPLACE(Address_E+' Phone:'+PhoneNo+' Email:'+Email, CHAR(13) + CHAR(10), '') from site where SiteID=#{site}
  297. </select>
  298. <select id="getPackagePrintData" resultType="com.heai.modules.production.entity.PackagePrintData">
  299. Select
  300. T.Site,
  301. T.OrderNo+'-'+Convert(Varchar(4),T.ItemNo) as TransNo,
  302. T.SeqNo as ItemNo,
  303. SO.PartNo,dbo.Get_PartDesc(T.Site,SO.PartNo) as PartDesc,
  304. dbo.Get_Part_Spec(T.Site,SO.PartNo) as PartSpec,
  305. dbo.Get_Part_UMID(T.Site,SO.PartNo) as umid ,
  306. T.AssJobSeqNo as SeqNo,
  307. T.Remark,CH.CustomerPONo as OrderRef4,
  308. Convert(Datetime,Convert(Integer,Convert(Float,T.StatisticDate))) as ReceiveDate,
  309. isnull((Select OurVendorCode from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as SiteName,
  310. t.OrderNo as BatchNo,
  311. T.OperatorID as Inspector,
  312. s1.Address_E as siteAdress ,
  313. 'Phone:'+s1.PhoneNo+' Email:'+s1.Email as sitePhone,
  314. convert(varchar(100),isnull(V.TextValue,'')) as bilNote,
  315. pi.id,
  316. pi.printQty,
  317. pi.UnitQty,
  318. SUBSTRING(LabelType, 5, 10) code,
  319. pi.KeyInfo_Str1 as keyInfoStr1,
  320. pi.KeyInfo_Str2 as keyInfoStr2
  321. from SFDC as T
  322. left join print_info pi on pi.Site=T.site and pi.status!='Y' and pi.orderRef1=T.OrderNo and pi.orderRef2=CONVERT(VARCHAR(10),T.ItemNo )
  323. and pi.orderRef3=CONVERT(VARCHAR(10),T.SeqNo )
  324. ,ShopOrder as SO
  325. Left Join COHeader as CH On CH.Site=SO.Site and CH.OrderNo=SO.OrderRef1
  326. left join site s1 on s1.SiteID=SO.Site
  327. ,Part as P
  328. Left Join PartSubPropertiesValue as V
  329. On P.Site=V.Site and P.PartNo=V.PartNo and P.CodeNo=V.CodeNo and V.SubCodeSeqNo=1 and V.RecordType='P' and V.PropertiesItemNo='BILNOTE'
  330. ,Site as S
  331. Where T.Site=S.SiteID and T.Site=SO.Site and T.OrderNo=SO.OrderNo
  332. and SO.Site=P.Site and SO.PartNo=P.PartNo
  333. AND pi.status='N' and pi.LabelType like '产品标签%' AND ComputerName=#{ip}
  334. </select>
  335. <select id="getJLPackagePrintData" resultType="com.heai.modules.production.entity.PackagePrintData">
  336. Select
  337. T.Site,
  338. T.ReceiptNo+'-'+Convert(Varchar(4),T.ItemNo) as TransNo,
  339. T.InspectItemNo as ItemNo,
  340. PD.PartNo,dbo.Get_PartDesc(T.Site,PD.PartNo) as PartDesc,
  341. dbo.Get_Part_Spec(T.Site,PD.PartNo) as PartSpec,
  342. dbo.Get_Part_UMID(T.Site,PD.PartNo) as umid ,
  343. T.InspectItemNo as SeqNo,
  344. T.Remark,'' as OrderRef4,
  345. Convert(Datetime,Convert(Integer,Convert(Float,T.InspectDate))) as ReceiveDate,
  346. '' as SiteName,
  347. PD.OrderNo as BatchNo,
  348. T.Inspector as Inspector,
  349. s.Address_E as siteAdress ,
  350. 'Phone:'+s.PhoneNo+' Email:'+s.Email as sitePhone,
  351. convert(varchar(100),isnull(V.TextValue,'')) as bilNote,
  352. pi.id,
  353. pi.printQty,
  354. pi.UnitQty,
  355. SUBSTRING(LabelType, 5, 10) code,
  356. pi.KeyInfo_Str1 as keyInfoStr1,
  357. pi.KeyInfo_Str2 as keyInfoStr2
  358. from POInspect as T
  359. left join print_info pi on pi.Site=T.site and pi.status!='Y' and pi.orderRef1=T.ReceiptNo and pi.orderRef2=CONVERT(VARCHAR(10),T.ItemNo )
  360. and pi.orderRef3=CONVERT(VARCHAR(10),T.InspectItemNo)
  361. ,POReceiptDetail as PD
  362. ,Part as P
  363. Left Join PartSubPropertiesValue as V
  364. On P.Site=V.Site and P.PartNo=V.PartNo and P.CodeNo=V.CodeNo and V.SubCodeSeqNo=1 and V.RecordType='P' and V.PropertiesItemNo='BILNOTE'
  365. ,Site as S
  366. Where T.Site=S.SiteID and T.Site=PD.Site and T.ReceiptNo=PD.ReceiptNo and T.ItemNo=PD.ItemNo
  367. and PD.Site=P.Site and PD.PartNo=P.PartNo
  368. AND pi.status='N' and pi.LabelType like '进料产品标签%'
  369. AND ComputerName=#{ip}
  370. </select>
  371. <select id="getSopAddress" resultType="com.heai.modules.production.entity.TvSopBaseData">
  372. select tv_id,work_station,now_seqNo,now_operator,PartNo,RevNo,ItemNo,Site,colourFlag from tv_sop_base where tv_id=#{tvId}
  373. </select>
  374. <select id="getPictureList" resultType="com.heai.modules.pad.entity.AttachmentListData">
  375. select AttaFileName_DB from AttachmentList where Site=#{site} and OrderRef1=#{partNo} and OrderRef2=#{revNo}
  376. and OrderRef3=#{itemNo} and OrderRef4=#{type} and DelFlag='N'
  377. </select>
  378. <select id="searchBIBoardAddress" resultType="BIBoardAddressData">
  379. select address from BIBoardAddress where reportId=#{reportId}
  380. </select>
  381. <select id="getPackagePrintDataList" resultType="com.heai.modules.production.entity.PackagePrintData">
  382. Select
  383. SO.PartNo,dbo.Get_PartDesc(T.Site,SO.PartNo) as PartDesc,
  384. dbo.Get_Part_Spec(T.Site,SO.PartNo) as PartSpec,
  385. dbo.Get_Part_UMID(T.Site,SO.PartNo) as umid ,T.WorkCenterNo,T.Site,
  386. T.AssJobSeqNo as SeqNo,
  387. T.Remark,CH.CustomerPONo as OrderRef4,
  388. Convert(Datetime,Convert(Integer,Convert(Float,T.StatisticDate))) as ReceiveDate,
  389. isnull((Select OurVendorCode from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as SiteName,
  390. t.OrderNo as BatchNo,
  391. T.OperatorID as Inspector,
  392. s1.Address_E as siteAdress ,
  393. 'Phone:'+s1.PhoneNo+' Email:'+s1.Email as sitePhone,
  394. 1 as printQty,
  395. <if test="number == null">
  396. convert(float,dbo.Get_PartValue(T.Site,SO.PartNo,'QTY/BAG')) as unitQty,
  397. </if>
  398. convert(varchar(100),isnull(V.TextValue,'')) as bilNote
  399. from SFDC as T
  400. ,ShopOrder as SO
  401. Left Join COHeader as CH On CH.Site=SO.Site and CH.OrderNo=SO.OrderRef1
  402. left join site s1 on s1.SiteID=SO.Site,Part as P
  403. Left Join PartSubPropertiesValue as V
  404. On P.Site=V.Site and P.PartNo=V.PartNo and P.CodeNo=V.CodeNo and V.SubCodeSeqNo=1 and V.RecordType='P' and V.PropertiesItemNo='BILNOTE'
  405. ,Site as S
  406. Where T.Site=S.SiteID and T.Site=SO.Site and T.OrderNo=SO.OrderNo
  407. and SO.Site=P.Site and SO.PartNo=P.PartNo and t.AssJobSeqNo = #{seqNo,jdbcType=INTEGER}
  408. </select>
  409. <select id="getCustomerInfo" resultType="java.util.HashMap">
  410. Select isnull((Select C.CustomerGroup from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as CustomerGroup,
  411. isnull((Select C.ABC from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as ABC,
  412. isnull((Select C.ShortCustomerName from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as CustomerDesc,
  413. isnull((Select C.LogoFileName from Customer as C Where C.Site=CH.Site and C.CustomerID=CH.CustomerID),'') as LogoFileName
  414. from ShopOrder as SO
  415. Left Join COHeader as CH On CH.Site=SO.Site and CH.OrderNo=SO.OrderRef1
  416. Where SO.Site = #{site} and SO.OrderNo = #{orderNo}
  417. </select>
  418. <select id="getWorkCenterProLineNo" resultType="java.lang.String">
  419. select dbo.Get_WorkCenter_ProLineNo(#{site},#{workCenterNo})
  420. </select>
  421. <select id="getPartValue" resultType="java.math.BigDecimal">
  422. select convert(float,dbo.Get_PartValue(#{site},#{partNo},'QTY/BAG'))
  423. </select>
  424. <select id="getPrintLabelRecordById" resultType="com.heai.modules.production.entity.PrintLabelRecord">
  425. select * from print_label_record where id = #{id}
  426. </select>
  427. </mapper>