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.

115 lines
4.0 KiB

  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.part.mapper.PartInformationMapper">
  4. <!-- 材料信息列表 -->
  5. <select id="partInformationSearch" parameterType="com.spring.modules.part.vo.PartInformationVo" resultType="com.spring.modules.part.vo.PartInformationVo">
  6. SELECT
  7. site,
  8. part_no,
  9. part_desc,
  10. spec,
  11. part_type_db,
  12. part_type,
  13. family_id,
  14. dbo.get_family_name(site, family_id) as familyName,
  15. group_id,
  16. dbo.get_group_name(site, group_id) as groupName,
  17. umid,
  18. active,
  19. supplier_id,
  20. dbo.get_supplier_name(site, supplier_id) as supplierName,
  21. other_group1,
  22. other_group2,
  23. other_group3,
  24. other_group4,
  25. erp_part_no,
  26. code_no,
  27. manufacturer_id,
  28. dbo.get_manufacturer_name(site, supplier_id) as manufacturerName,
  29. create_date,
  30. create_by,
  31. update_date,
  32. update_by
  33. FROM part
  34. <where>
  35. site = #{query.site}
  36. <if test = "query.partNo != null and query.partNo != ''">
  37. AND part_no like #{query.partNo}
  38. </if>
  39. <if test = "query.erpPartNo != null and query.erpPartNo != ''">
  40. AND erp_part_no like #{query.erpPartNo}
  41. </if>
  42. <if test = "query.partDesc != null and query.partDesc != ''">
  43. AND part_desc like #{query.partDesc}
  44. </if>
  45. <if test = "query.spec != null and query.spec != ''">
  46. AND spec like #{query.spec}
  47. </if>
  48. <if test="query.startDate != null ">
  49. AND required_completion_date >= #{query.startDate}
  50. </if>
  51. <if test="query.endDate != null ">
  52. AND #{query.endDate} >= required_completion_date
  53. </if>
  54. </where>
  55. </select>
  56. <!-- 获取材料编码 -->
  57. <select id="getPartNo" resultType="string" parameterType="PartInformationEntity">
  58. SELECT
  59. Right('0000000000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(part_no, 3, 10))), 0) + 1), 8)
  60. FROM part
  61. WHERE site = #{site}
  62. </select>
  63. <!--按照orderRef1查询文件文件参数-->
  64. <select id="getFileContentList" resultType="SysOssEntity" parameterType="SysOssEntity">
  65. SELECT
  66. id,
  67. url,
  68. create_date,
  69. file_name,
  70. new_file_name,
  71. create_by,
  72. order_ref1,
  73. order_ref2,
  74. order_ref3,
  75. file_type,
  76. file_suffix,
  77. file_type_code,
  78. file_remark
  79. FROM sys_oss
  80. <where>
  81. <if test="orderRef1 != '' and orderRef1 != null ">
  82. and order_ref1 = #{orderRef1}
  83. </if>
  84. <if test="orderRef2 != '' and orderRef2 != null ">
  85. and order_ref2 = #{orderRef2}
  86. </if>
  87. <if test="orderRef3 != '' and orderRef3 != null ">
  88. and order_ref3 = #{orderRef3}
  89. </if>
  90. </where>
  91. </select>
  92. <!-- 获得报价单号 -->
  93. <select id="getQuotationNo" resultType="string" parameterType="QuotationInformationEntity">
  94. SELECT
  95. Right('0000000000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(quotation_no, 3, 10))), 0) + 1), 8)
  96. FROM plm_quotation_information
  97. WHERE site = #{site}
  98. </select>
  99. <!-- 批量删除文件-->
  100. <delete id="batchDeleteQuotationFile" parameterType="com.spring.modules.quotation.vo.SysOssVo">
  101. DELETE FROM sys_oss
  102. <where>
  103. order_ref1 = #{orderRef1} and order_ref2 = #{orderRef2}
  104. <if test = "fileName != null and fileName != ''">
  105. AND file_name = #{fileName}
  106. </if>
  107. </where>
  108. </delete>
  109. </mapper>