O
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.

98 lines
3.0 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
  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.xujie.sys.modules.quote.mapper.QuoteDetailBomMapper">
  4. <select id="queryQuoteDetailBom" resultType="com.xujie.sys.modules.quote.entity.QuoteDetailBom">
  5. select
  6. qdb.id,
  7. qdb.quote_id,
  8. qdb.quote_detail_id,
  9. qdb.quote_detail_item_no,
  10. qdb.site,
  11. qdb.bu_no,
  12. qdb.quote_no,
  13. qdb.version_no,
  14. qdb.part_no,
  15. qdb.eng_chg_level,
  16. qdb.bom_type,
  17. qdb.alternative_no,
  18. qdb.component_part,
  19. <!-- qdb.print_unit,-->
  20. dbo.qc_get_um_name(qdb.site, qdb.print_unit) as print_unit,
  21. qdb.qty_per_assembly,
  22. qdb.component_scrap,
  23. qdb.issue_type,
  24. qdb.shrinkage_factor,
  25. (100-qdb.shrinkage_factor) as yield_rate,
  26. qdb.line_item_no,
  27. qdb.operation_id,
  28. qdb.issue_to_loc,
  29. qdb.note_text,
  30. qdb.line_sequence,
  31. qdb.consumption_item,
  32. qdb.create_by,
  33. qdb.create_date,
  34. qdb.tree_id,
  35. p.part_desc,
  36. qdb.unit_price,
  37. qdb.actual_price,
  38. qdb.quote_price
  39. from plm_quote_detail_bom qdb
  40. left join part p on qdb.site = p.site and qdb.component_part = p.part_no
  41. where quote_detail_id = #{quoteDetailId}
  42. <if test="treeId!= null">
  43. and tree_id = #{treeId}
  44. </if>
  45. order by tree_id
  46. </select>
  47. <select id="queryQuoteDetailBomByIds" resultType="com.xujie.sys.modules.quote.entity.QuoteDetailBom">
  48. select
  49. qdb.id,
  50. qdb.quote_id,
  51. qdb.quote_detail_id,
  52. qdb.quote_detail_item_no,
  53. qdb.site,
  54. qdb.bu_no,
  55. qdb.quote_no,
  56. qdb.version_no,
  57. qdb.part_no,
  58. qdb.eng_chg_level,
  59. qdb.bom_type,
  60. qdb.alternative_no,
  61. qdb.component_part,
  62. <!-- qdb.print_unit,-->
  63. dbo.qc_get_um_name(qdb.site, qdb.print_unit) as print_unit,
  64. qdb.qty_per_assembly,
  65. qdb.component_scrap,
  66. qdb.issue_type,
  67. qdb.shrinkage_factor,
  68. (100-qdb.shrinkage_factor) as yield_rate,
  69. qdb.line_item_no,
  70. qdb.operation_id,
  71. qdb.issue_to_loc,
  72. qdb.note_text,
  73. qdb.line_sequence,
  74. qdb.consumption_item,
  75. qdb.create_by,
  76. qdb.create_date,
  77. qdb.tree_id,
  78. p.part_desc,
  79. qdb.unit_price,
  80. qdb.actual_price,
  81. qdb.quote_price
  82. from plm_quote_detail_bom qdb
  83. left join part p on qdb.site = p.site and qdb.component_part = p.part_no
  84. <where>
  85. <if test="quoteDetailId != null">
  86. and qdb.quote_detail_id = #{quoteDetailId}
  87. </if>
  88. <if test="ids != null and ids.size() > 0">
  89. and qdb.tree_id in
  90. <foreach collection="ids" item="id" open="(" separator="," close=")">
  91. #{id}
  92. </foreach>
  93. </if>
  94. </where>
  95. order by tree_id
  96. </select>
  97. </mapper>