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.

155 lines
7.1 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
3 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
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.proofing.mapper.ProofingInformationMapper">
  4. <!-- 打样信息列表 -->
  5. <select id="proofingInformationSearch" parameterType="com.spring.modules.proofing.vo.ProofingInformationVo" resultType="com.spring.modules.proofing.vo.ProofingInformationVo">
  6. SELECT a.id,
  7. a.site,
  8. proofing_no,
  9. a.project_id,
  10. dbo.plm_get_project_name(a.site, a.project_id) as projectName,
  11. a.test_part_no,
  12. dbo.plm_get_test_part_desc(a.site, a.test_part_no) as partName,
  13. customer_no,
  14. dbo.plm_get_customer_desc(a.site, customer_no) as customerDesc,
  15. tracker,
  16. dbo.plm_get_user_display(a.site, tracker) as trackerName,
  17. engineer,
  18. dbo.plm_get_user_display(a.site, engineer) as engineerName,
  19. approver,
  20. dbo.plm_get_user_display(a.site, approver) as approverName,
  21. priority_level,
  22. proofing_number,
  23. required_delivery_date,
  24. a.remark,
  25. technical_considerations,
  26. is_need_to_send_samples,
  27. send_samples_address,
  28. consignee,
  29. consignee_contact,
  30. actuality_delivery_date,
  31. proofing_result_information,
  32. actuality_send_samples_date,
  33. send_samples_method,
  34. deliver_goods_information,
  35. deliver_goods_remark,
  36. actuality_reply_date,
  37. confirm_results,
  38. confirm_by,
  39. confirm_information,
  40. proofing_status,
  41. proofing_result_status,
  42. next_to_do,
  43. a.create_date,
  44. a.create_by,
  45. a.update_date,
  46. a.update_by,
  47. a.step_id,
  48. reject_flag,
  49. reject_step_id,
  50. d.is_reject,
  51. d.node_id,
  52. d.node_name,
  53. vpp.bu_no,
  54. b.bu_desc
  55. FROM plm_proofing_information as a
  56. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = #{query.menuId}
  57. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  58. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  59. left join view_Project_Part vpp
  60. on vpp.site = a.site and vpp.test_part_no = a.test_part_no and vpp.project_id = a.project_id
  61. left join BU b on vpp.bu_no = b.bu_no and a.site = b.site
  62. <where>
  63. a.site = #{query.site}
  64. <if test="query.createBy != null and query.createBy != ''">
  65. and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
  66. </if>
  67. <if test="query.customerNo != null and query.customerNo != ''">
  68. AND customer_no like #{query.customerNo}
  69. </if>
  70. <if test="query.proofingNo != null and query.proofingNo != ''">
  71. AND proofing_no like #{query.proofingNo}
  72. </if>
  73. <if test="query.customerDesc != null and query.customerDesc != ''">
  74. AND dbo.plm_get_customer_desc(a.site, customer_no) like #{query.customerDesc}
  75. </if>
  76. <if test="query.projectId != null and query.projectId != ''">
  77. AND a.project_id like #{query.projectId}
  78. </if>
  79. <if test="query.projectName != null and query.projectName != ''">
  80. AND dbo.plm_get_project_name(a.site, a.project_id) like #{query.projectName}
  81. </if>
  82. <if test="query.trackerName != null and query.trackerName != ''">
  83. AND dbo.plm_get_user_display(a.site, tracker) like #{query.trackerName}
  84. </if>
  85. <if test="query.engineerName != null and query.engineerName != ''">
  86. AND dbo.plm_get_user_display(a.site, engineer) like #{query.engineerName}
  87. </if>
  88. <if test="query.testPartNo != null and query.testPartNo != ''">
  89. AND a.test_part_no like #{query.testPartNo}
  90. </if>
  91. <if test="query.partName != null and query.partName != ''">
  92. AND dbo.plm_get_test_part_desc(a.site, a.test_part_no) like #{query.partName}
  93. </if>
  94. <if test="query.proofingStatus != null and query.proofingStatus != ''">
  95. AND proofing_status = #{query.proofingStatus}
  96. </if>
  97. <if test="query.proofingResultStatus != null and query.proofingResultStatus != ''">
  98. AND proofing_result_status = #{query.proofingResultStatus}
  99. </if>
  100. <if test="query.priorityLevel != null and query.priorityLevel != ''">
  101. AND priority_level = #{query.priorityLevel}
  102. </if>
  103. <if test="query.startDate != null">
  104. AND required_delivery_date >= #{query.startDate}
  105. </if>
  106. <if test="query.endDate != null">
  107. AND #{query.endDate} >= required_delivery_date
  108. </if>
  109. <if test="query.buNo != null and query.buNo != ''">
  110. AND vpp.bu_no = #{query.buNo}
  111. </if>
  112. </where>
  113. order by proofing_no desc
  114. </select>
  115. <!-- 获得打样单号 -->
  116. <select id="getProofingNo" resultType="string" parameterType="ProofingInformationEntity">
  117. SELECT
  118. Right('0000000000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(proofing_no, 3, 10))), 0) + 1), 8)
  119. FROM plm_proofing_information
  120. WHERE site = #{site}
  121. </select>
  122. <select id="searchDelegateAccess" resultType="com.spring.modules.proofing.vo.ProofingDelegateAccessVo">
  123. select
  124. site,
  125. proofing_no,
  126. delegate_access,
  127. dbo.plm_get_user_display(site, delegate_access) as delegateAccessName
  128. from plm_proofing_delegate_access
  129. <where>
  130. <if test="site != null and site != ''">
  131. and site = #{site}
  132. </if>
  133. <if test="proofingNo != null and proofingNo != ''">
  134. and proofing_no = #{proofingNo}
  135. </if>
  136. </where>
  137. </select>
  138. <select id="searchDelegateAccessByUser" resultType="com.spring.modules.proofing.vo.ProofingDelegateAccessVo">
  139. select a.username as delegateAccess, a.user_display as delegateAccessName
  140. from sys_user a
  141. left join AccessRole b on a.username = b.username and a.site = b.site
  142. where b.role_no = #{roleId} and a.site = #{params.site}
  143. <if test="params.delegateAccess != null and params.delegateAccess != ''">
  144. and a.username like #{params.delegateAccess}
  145. </if>
  146. <if test="params.delegateAccessName != null and params.delegateAccessName != ''">
  147. and a.user_display like #{params.delegateAccessName}
  148. </if>
  149. </select>
  150. </mapper>