ccl冷凝胶后端
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.

201 lines
6.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 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.spring.modules.material.dao.SeekByTransMapper">
  4. <!-- 物料出入库查询-->
  5. <select id="findAll" resultType="com.spring.modules.material.data.FindByTrans">
  6. SELECT
  7. a.site,
  8. a.transNo,
  9. a.transDate,
  10. a.warehouseID,
  11. c.partNo,
  12. c.transQty,
  13. c.batchNo,
  14. c.locationID,
  15. c.wdr_no,
  16. c.manufactureDate,
  17. a.orderRef1,
  18. a.receiver,
  19. a.enterDate,
  20. a.userName,
  21. a.transType,
  22. d.part_desc,
  23. c.itemNo,
  24. (SELECT COUNT(*)
  25. FROM TransDetailsub
  26. WHERE transNo = a.transNo AND itemNo = c.itemNo) AS num
  27. FROM
  28. TransHeader AS a
  29. LEFT JOIN TransDetail AS c ON a.Site = c.Site
  30. AND a.TransNo = c.TransNo
  31. LEFT JOIN part AS d ON d.part_no = c.partNo
  32. <where>
  33. <if test = "list.partNo != null and list.partNo != ''">
  34. AND c.partNo = #{list.partNo}
  35. </if>
  36. <if test = "list.locationID != null and list.locationID != ''">
  37. AND c.locationID = #{list.locationID}
  38. </if>
  39. <if test = "list.partDesc != null and list.partDesc != ''">
  40. AND d.part_desc = #{list.partDesc}
  41. </if>
  42. <if test = "list.transType != null and list.transType != ''">
  43. AND a.transType = #{list.transType}
  44. </if>
  45. <if test = "list.transNo != null and list.transNo != ''">
  46. AND a.transNo = #{list.transNo}
  47. </if>
  48. </where>
  49. </select>
  50. <select id="fingByRollNo" resultType="com.spring.modules.material.entity.TransDetailsub">
  51. SELECT
  52. TransNo,Site,SeqNo,itemNo,LocationID,BatchNo,BoxNo,RollNo,RollQty,orderRef1
  53. FROM
  54. TransDetailsub
  55. WHERE
  56. transNo = #{transNo}
  57. AND itemNo = #{itemNo}
  58. </select>
  59. <!--库存清单查询-->
  60. <select id="findByNum" resultType="com.spring.modules.material.data.FindByNum">
  61. SELECT
  62. a.Site,
  63. a.partNo,
  64. a.QtyOnHand,
  65. a.batchNo,
  66. a.locationID,
  67. a.manufactureDate,
  68. a.FirstInDate,
  69. a.warehouseID,
  70. b.part_desc,
  71. a.expiredDate,
  72. DATEDIFF(
  73. DAY,
  74. GETDATE(),
  75. a.expiredDate
  76. ) AS daysUntilExpired
  77. FROM
  78. InventoryStock AS a
  79. LEFT JOIN part AS b ON a.Site = b.Site
  80. AND a.PartNo = b.part_no
  81. <where>
  82. <if test = "list.partNo != null and list.partNo != ''">
  83. AND a.partNo = #{list.partNo}
  84. </if>
  85. <if test = "list.locationID != null and list.locationID != ''">
  86. AND a.locationID = #{list.locationID}
  87. </if>
  88. <if test = "list.partDesc != null and list.partDesc != ''">
  89. AND b.part_desc = #{list.partDesc}
  90. </if>
  91. </where>
  92. </select>
  93. <select id="sendByTime" resultType="com.spring.modules.material.entity.TransDetail">
  94. select trans_no ,expiredDate from TransDetail
  95. </select>
  96. <!-- 物料出入库按卷号查询-->
  97. <select id="findByRoll" resultType="com.spring.modules.material.data.FindByRoll">
  98. SELECT
  99. a.site,
  100. a.transNo,
  101. a.transDate,
  102. a.warehouseID,
  103. b.rollNo,
  104. c.partNo,
  105. c.transQty,
  106. c.batchNo,
  107. c.locationID,
  108. c.wdr_no,
  109. c.manufactureDate,
  110. a.orderRef1,
  111. a.receiver,
  112. a.enterDate,
  113. a.userName,
  114. a.transType,
  115. d.part_desc,
  116. c.itemNo
  117. FROM
  118. TransHeader AS a
  119. LEFT JOIN TransDetail AS c ON a.Site = c.Site
  120. AND a.TransNo = c.TransNo
  121. LEFT JOIN part AS d ON d.part_no = c.partNo
  122. LEFT JOIN TransDetailsub AS b ON b.Site = c.Site
  123. AND b.TransNo = c.TransNo
  124. <where>
  125. <if test = "list.partNo != null and list.partNo != ''">
  126. AND c.partNo = #{list.partNo}
  127. </if>
  128. <if test = "list.locationID != null and list.locationID != ''">
  129. AND c.locationID = #{list.locationID}
  130. </if>
  131. <if test = "list.partDesc != null and list.partDesc != ''">
  132. AND d.part_desc = #{list.partDesc}
  133. </if>
  134. <if test = "list.transType != null and list.transType != ''">
  135. AND a.transType = #{list.transType}
  136. </if>
  137. <if test = "list.rollNo != null and list.rollNo != ''">
  138. AND b.rollNo = #{list.rollNo}
  139. </if>
  140. <if test = "list.transNo != null and list.transNo != ''">
  141. AND a.transNo = #{list.transNo}
  142. </if>
  143. </where>
  144. </select>
  145. <select id="findByNumOrRollNo" resultType="com.spring.modules.material.data.FindByNumOrRollNo">
  146. select RollNo,QtyOnHand,manufactureDate from InventoryStock_Roll
  147. where Site = #{site}
  148. AND WarehouseID = #{warehouseID}
  149. AND PartNo = #{partNo}
  150. AND BatchNo = #{batchNo}
  151. AND LocationID = #{locationID}
  152. </select>
  153. <!-- 物料清单案卷号查询-->
  154. <select id="findAllByRolls" resultType="com.spring.modules.material.data.FindAllByRolls">
  155. SELECT
  156. a.Site,
  157. a.partNo,
  158. a.QtyOnHand,
  159. a.batchNo,
  160. a.locationID,
  161. a.manufactureDate,
  162. a.FirstInDate,
  163. a.warehouseID,
  164. b.part_desc,
  165. a.expiredDate,
  166. a.RollNo,
  167. DATEDIFF(
  168. DAY,
  169. GETDATE(),
  170. a.expiredDate
  171. ) AS daysUntilExpired
  172. FROM
  173. InventoryStock_Roll AS a
  174. LEFT JOIN part AS b ON a.Site = b.Site
  175. AND a.PartNo = b.part_no
  176. <where>
  177. <if test = "list.partNo != null and list.partNo != ''">
  178. AND a.partNo = #{list.partNo}
  179. </if>
  180. <if test = "list.locationID != null and list.locationID != ''">
  181. AND a.locationID = #{list.locationID}
  182. </if>
  183. <if test = "list.partDesc != null and list.partDesc != ''">
  184. AND b.part_desc = #{list.partDesc}
  185. </if>
  186. <if test = "list.RollNo != null and list.RollNo != ''">
  187. AND a.RollNo = #{list.rollNo}
  188. </if>
  189. <if test = "list.qtyOnHand != null ">
  190. AND a.QtyOnHand > #{list.qtyOnHand}
  191. </if>
  192. </where>
  193. </select>
  194. </mapper>