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.

594 lines
23 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
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
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.part.mapper.BomManagementMapper">
  4. <!-- 材料信息列表 -->
  5. <select id="bomManagementSearch" parameterType="com.spring.modules.part.vo.BomHeaderVo" resultType="com.spring.modules.part.vo.BomHeaderVo">
  6. SELECT
  7. a.site,
  8. a.part_no,
  9. dbo.get_part_name(a.site, a.part_no) as partDesc,
  10. a.eng_chg_level,
  11. a.bom_type,
  12. a.note_text,
  13. a.eff_phase_in_date,
  14. a.eff_phase_out_date,
  15. a.eng_revision,
  16. a.type_flag,
  17. a.net_weight,
  18. a.create_date,
  19. a.create_by,
  20. a.update_date,
  21. a.update_by,
  22. b.um_id as printUnit,
  23. dbo.get_um_name(b.um_id) as printUnitName
  24. FROM plm_bom_header as a
  25. left join part as b on a.site = b.site and a.part_no = b.part_no
  26. <where>
  27. a.site = #{query.site}
  28. <if test = "query.partNo != null and query.partNo != ''">
  29. AND a.part_no like #{query.partNo}
  30. </if>
  31. <if test = "query.partDesc != null and query.partDesc != ''">
  32. AND dbo.get_part_name(a.site, a.part_no) like #{query.partDesc}
  33. </if>
  34. </where>
  35. </select>
  36. <!-- 查询物料清单 -->
  37. <select id="queryPartList" parameterType="ComponentPartData" resultType="BomAllFieldEntity">
  38. SELECT
  39. site,
  40. part_no,
  41. part_desc,
  42. spec,
  43. um_id as printUnit,
  44. dbo.get_um_name(um_id) as printUnitName,
  45. part_type
  46. FROM part
  47. <where>
  48. site = #{site} and active = 'Y'
  49. <if test = "partNo != null and partNo != ''">
  50. AND part_no = #{partNo}
  51. </if>
  52. <if test = "partDesc != null and partDesc != ''">
  53. AND part_desc like #{partDesc}
  54. </if>
  55. <if test = "status != null and status != ''">
  56. AND status = #{status}
  57. </if>
  58. </where>
  59. </select>
  60. <!-- 新增BOM主表内容 -->
  61. <insert id="saveBomHeader" parameterType="BomHeaderEntity">
  62. INSERT INTO plm_bom_header
  63. (site, part_no, eng_chg_level, bom_type, note_text, eff_phase_in_date, eff_phase_out_date, eng_revision, type_flag, net_weight, official_flag, create_date, create_by)
  64. VALUES
  65. (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{noteText}, #{effPhaseInDate}, #{effPhaseOutDate}, #{engRevision}, #{typeFlag}, #{netWeight}, #{officialFlag}, getDate(), #{createBy})
  66. </insert>
  67. <!-- bom明细新增 -->
  68. <insert id="bomDetailSave" parameterType="BomDetailEntity">
  69. INSERT INTO plm_bom_detail
  70. (site, part_no, eng_chg_level, bom_type, alternative_no, alternative_description, status, min_lot_qty, default_flag, note_text, create_date, create_by, official_flag)
  71. VALUES
  72. (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{alternativeDescription}, #{status}, #{minLotQty}, #{defaultFlag}, #{detailNoteText}, getDate(), #{createBy}, #{officialFlag})
  73. </insert>
  74. <!-- 新增BOM子明细表内容 -->
  75. <insert id="saveBomComponent" parameterType="BomComponentEntity">
  76. INSERT INTO plm_bom_component
  77. (site, part_no, eng_chg_level, bom_type, alternative_no, component_part, line_item_no, print_unit, qty_per_assembly, component_scrap, shrinkage_factor, issue_type, issue_to_loc, operation_id, note_text, create_date, create_by, line_sequence)
  78. VALUES
  79. (#{site}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{componentPart}, #{lineItemNo}, #{printUnit}, #{qtyPerAssembly}, #{componentScrap}, #{shrinkageFactor}, #{issueType}, #{issueToLoc}, #{operationId}, #{noteText}, getDate(), #{createBy}, #{lineSequence})
  80. </insert>
  81. <!-- 查bom明细 -->
  82. <select id="queryBomDetail" parameterType="BomHeaderEntity" resultType="BomDetailEntity">
  83. SELECT
  84. site,
  85. part_no,
  86. bom_type,
  87. eng_chg_level,
  88. alternative_no,
  89. alternative_description,
  90. status,
  91. min_lot_qty,
  92. default_flag,
  93. note_text as detailNoteText,
  94. official_flag
  95. FROM plm_bom_detail
  96. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel}
  97. </select>
  98. <!-- 查bom明细对象 -->
  99. <select id="queryDetailDataByNo" parameterType="BomDetailEntity" resultType="BomDetailEntity">
  100. SELECT
  101. site,
  102. part_no,
  103. bom_type,
  104. eng_chg_level,
  105. alternative_no,
  106. alternative_description,
  107. status,
  108. min_lot_qty,
  109. default_flag,
  110. note_text as detailNoteText,
  111. official_flag
  112. FROM plm_bom_detail
  113. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel} and alternative_no = #{alternativeNo}
  114. </select>
  115. <!-- 查bom子明细 -->
  116. <select id="queryBomComponent" parameterType="BomDetailEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
  117. SELECT
  118. site,
  119. part_no,
  120. bom_type,
  121. eng_chg_level,
  122. alternative_no,
  123. component_part,
  124. dbo.get_part_name(site, component_part) as componentPartDesc,
  125. print_unit,
  126. dbo.get_um_name(print_unit) as printUnitName,
  127. qty_per_assembly,
  128. component_scrap,
  129. issue_type,
  130. shrinkage_factor,
  131. line_item_no,
  132. operation_id,
  133. issue_to_loc,
  134. dbo.get_location_name(site, issue_to_loc) as issueToLocName,
  135. note_text,
  136. line_sequence
  137. FROM plm_bom_component
  138. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel} and alternative_no = #{alternativeNo}
  139. order by line_sequence
  140. </select>
  141. <!-- bom主表编辑 -->
  142. <update id="updateBomHeader" parameterType="BomAllFieldEntity">
  143. update plm_bom_header
  144. set eff_phase_in_date = #{effPhaseInDate},
  145. eff_phase_out_date = #{effPhaseOutDate},
  146. eng_revision = #{engRevision},
  147. type_flag = #{typeFlag},
  148. net_weight = #{netWeight},
  149. note_text = #{noteText},
  150. update_date = getDate(),
  151. update_by = #{updateBy}
  152. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  153. </update>
  154. <!-- bom明细表编辑 -->
  155. <update id="updateBomDetail" parameterType="BomDetailEntity">
  156. update plm_bom_detail
  157. set alternative_description = #{alternativeDescription},
  158. min_lot_qty = #{minLotQty},
  159. note_text = #{detailNoteText},
  160. status = #{status},
  161. update_date = getDate(),
  162. update_by = #{updateBy}
  163. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  164. </update>
  165. <!-- 删除bom子明细 -->
  166. <delete id="deleteBomComponent" parameterType="BomAllFieldEntity">
  167. delete from plm_bom_component
  168. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  169. </delete>
  170. <!-- 删除替代 -->
  171. <delete id="bomDetailDelete" parameterType="BomDetailEntity">
  172. delete from plm_bom_detail
  173. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  174. </delete>
  175. <!-- bom主表查重 -->
  176. <select id="checkBomOnlyOne" parameterType="BomAllFieldEntity" resultType="com.spring.modules.part.vo.BomHeaderVo">
  177. SELECT
  178. site,
  179. part_no,
  180. dbo.get_part_name(site, part_no) as partDesc,
  181. bom_type,
  182. eng_chg_level,
  183. eff_phase_in_date,
  184. eff_phase_out_date,
  185. eng_revision,
  186. type_flag,
  187. net_weight,
  188. note_text,
  189. official_flag
  190. FROM plm_bom_header
  191. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel}
  192. </select>
  193. <!-- bom明细查重 -->
  194. <select id="checkBomDetailOnlyOne" parameterType="BomDetailEntity" resultType="BomDetailEntity">
  195. SELECT
  196. site,
  197. part_no,
  198. bom_type,
  199. eng_chg_level,
  200. alternative_no,
  201. alternative_description,
  202. bom_type,
  203. eng_chg_level,
  204. min_lot_qty,
  205. default_flag,
  206. note_text as detailNoteText,
  207. status,
  208. official_flag
  209. FROM plm_bom_detail
  210. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel} and alternative_no = #{alternativeNo}
  211. </select>
  212. <!-- 批量删除子明细物料 -->
  213. <delete id="deleteBomComponents" parameterType="BomComponentEntity">
  214. delete from plm_bom_component
  215. where site = #{site}
  216. and part_no = #{partNo}
  217. and eng_chg_level = #{engChgLevel}
  218. and bom_type = #{bomType}
  219. and alternative_no = #{alternativeNo}
  220. and line_item_no = #{lineItemNo}
  221. </delete>
  222. <!-- 删除bom子明细 -->
  223. <delete id="deleteBomComponentByPartNo" parameterType="BomHeaderEntity">
  224. delete from plm_bom_component
  225. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  226. </delete>
  227. <!-- 删除bom明细 -->
  228. <delete id="deleteBomDetailByPartNo" parameterType="BomHeaderEntity">
  229. delete from plm_bom_detail
  230. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  231. </delete>
  232. <!-- 删除bom主记录 -->
  233. <delete id="deleteBomHeaderByPartNo" parameterType="BomHeaderEntity">
  234. delete from plm_bom_header
  235. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  236. </delete>
  237. <!-- bom明细查重 -->
  238. <select id="checkBomComponentOnlyOne" parameterType="BomComponentEntity" resultType="BomComponentEntity">
  239. SELECT
  240. site,
  241. part_no,
  242. bom_type,
  243. eng_chg_level,
  244. alternative_no,
  245. component_part,
  246. line_item_no
  247. FROM plm_bom_component
  248. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel} and alternative_no = #{alternativeNo} and line_item_no = #{lineItemNo}
  249. </select>
  250. <!-- 修改bom子明细 -->
  251. <update id="updateBomComponent" parameterType="BomComponentEntity">
  252. update plm_bom_component
  253. set qty_per_assembly = #{qtyPerAssembly},
  254. component_scrap = #{componentScrap},
  255. issue_type = #{issueType},
  256. shrinkage_factor = #{shrinkageFactor},
  257. operation_id = #{operationId},
  258. issue_to_loc = #{issueToLoc},
  259. note_text = #{noteText},
  260. line_sequence = #{lineSequence},
  261. update_date = getDate(),
  262. update_by = #{updateBy}
  263. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo} and line_item_no = #{lineItemNo}
  264. </update>
  265. <!-- 修改替代状态 -->
  266. <update id="updateAlternativeStatus" parameterType="BomDetailEntity">
  267. update plm_bom_detail
  268. set status = #{status},
  269. update_date = getDate(),
  270. update_by = #{updateBy}
  271. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  272. </update>
  273. <!-- 查bom明细对象 -->
  274. <select id="queryOperationList" parameterType="OperationEntity" resultType="OperationEntity">
  275. select
  276. a.site,
  277. a.part_no,
  278. a.routing_revision,
  279. a.routing_type,
  280. a.alternative_no,
  281. b.alternative_description,
  282. b.status,
  283. a.operation_id,
  284. a.operation_no,
  285. a.operation_name
  286. from plm_routing_component as a
  287. left join plm_routing_detail as b on a.site = b.site and a.part_no = b.part_no and a.routing_revision = b.routing_revision and a.routing_type = b.routing_type and a.alternative_no = b.alternative_no
  288. <where>
  289. a.site = #{site} and a.part_no = #{partNo}
  290. <if test = "routingRevision != null and routingRevision != ''">
  291. AND a.routing_revision = #{routingRevision}
  292. </if>
  293. <if test = "routingType != null and routingType != ''">
  294. AND a.routing_type = #{routingType}
  295. </if>
  296. <if test = "alternativeNo != null and alternativeNo != ''">
  297. AND a.alternative_no = #{alternativeNo}
  298. </if>
  299. <if test = "operationNo != null and operationNo != ''">
  300. AND a.operation_no = #{operationNo}
  301. </if>
  302. <if test = "operationName != null and operationName != ''">
  303. AND a.operation_name like #{operationName}
  304. </if>
  305. <if test = "operationId != null and operationId != ''">
  306. AND a.operation_id = #{operationId}
  307. </if>
  308. </where>
  309. </select>
  310. <!-- 查 max line_item_no -->
  311. <select id="selectMaxLineItemNo" parameterType="BomComponentEntity" resultType="BomComponentEntity">
  312. SELECT
  313. site,
  314. part_no,
  315. eng_chg_level,
  316. bom_type,
  317. alternative_no,
  318. component_part,
  319. line_item_no
  320. FROM plm_bom_component
  321. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo} and line_item_no = (
  322. SELECT MAX(line_item_no)
  323. FROM plm_bom_component
  324. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo})
  325. </select>
  326. <!-- 判断是否已有该物料的 bom -->
  327. <select id="queryPartBom" parameterType="BomAllFieldEntity" resultType="com.spring.modules.part.vo.BomHeaderVo">
  328. SELECT top 1
  329. site,
  330. part_no,
  331. bom_type,
  332. eng_chg_level,
  333. note_text,
  334. eff_phase_in_date,
  335. eff_phase_out_date,
  336. eng_revision,
  337. net_weight,
  338. official_flag
  339. FROM plm_bom_header
  340. WHERE site = #{site} and part_no = #{partNo} and bom_type = #{bomType} order by eng_chg_level desc
  341. </select>
  342. <!-- 获取子料的序号 -->
  343. <select id="getComponentLineSequence" parameterType="BomAllFieldEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
  344. SELECT top 1
  345. site,
  346. part_no,
  347. eng_chg_level,
  348. bom_type,
  349. alternative_no,
  350. line_sequence
  351. FROM plm_bom_component
  352. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo} order by line_sequence desc
  353. </select>
  354. <!-- 判断该 bom 是否有 Buildable Obsolete 状态的替代 -->
  355. <select id="queryAlternativeStatus" parameterType="BomHeaderEntity" resultType="com.spring.modules.part.vo.BomDetailVo">
  356. SELECT
  357. site,
  358. part_no,
  359. eng_chg_level,
  360. bom_type,
  361. alternative_no,
  362. status
  363. FROM plm_bom_detail
  364. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and (status = 'Buildable' or status = 'Obsolete')
  365. </select>
  366. <!-- 判断 BOM 是否存在子料 -->
  367. <select id="queryComponentPart" parameterType="BomHeaderEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
  368. SELECT
  369. site,
  370. part_no,
  371. eng_chg_level,
  372. bom_type,
  373. alternative_no,
  374. component_part
  375. FROM plm_bom_component
  376. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  377. </select>
  378. <!-- 判断 BOM 是否存在子料 -->
  379. <select id="queryComponentPart2" parameterType="BomDetailEntity" resultType="com.spring.modules.part.vo.BomComponentVo">
  380. SELECT
  381. site,
  382. part_no,
  383. eng_chg_level,
  384. bom_type,
  385. alternative_no,
  386. component_part
  387. FROM plm_bom_component
  388. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  389. </select>
  390. <!-- 获取ifs header 对象-->
  391. <select id="getBomHeader" parameterType="BomDetailEntity" resultType="BomIfsHeader">
  392. SELECT
  393. site as contract,
  394. part_no,
  395. eng_chg_level,
  396. bom_type,
  397. eff_phase_in_date,
  398. eff_phase_out_date,
  399. note_text,
  400. create_date,
  401. 'add' as histType
  402. FROM plm_bom_header
  403. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  404. </select>
  405. <!-- 获取ifs component 对象-->
  406. <select id="getBomComponent" parameterType="BomDetailEntity" resultType="BomIfsItem">
  407. SELECT
  408. site as contract,
  409. part_no,
  410. eng_chg_level,
  411. bom_type,
  412. alternative_no,
  413. line_item_no,
  414. line_sequence,
  415. component_part,
  416. qty_per_assembly,
  417. issue_type,
  418. component_scrap,
  419. shrinkage_factor,
  420. note_text,
  421. 'add' as histType
  422. FROM plm_bom_component
  423. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType} and alternative_no = #{alternativeNo}
  424. </select>
  425. <!-- 获取bom header 对象-->
  426. <select id="queryBomHeader" parameterType="BomHeaderEntity" resultType="BomHeaderEntity">
  427. SELECT
  428. site,
  429. part_no,
  430. eng_chg_level,
  431. bom_type,
  432. note_text,
  433. eff_phase_in_date,
  434. eff_phase_out_date,
  435. eng_revision,
  436. row_version,
  437. row_key,
  438. type_flag,
  439. net_weight
  440. FROM plm_bom_header
  441. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  442. </select>
  443. <!-- bom主表编辑 -->
  444. <update id="updateInDate" parameterType="BomHeaderEntity">
  445. update plm_bom_header
  446. set eff_phase_out_date = #{effPhaseOutDate},
  447. update_date = getDate(),
  448. update_by = #{createBy}
  449. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel} and bom_type = #{bomType}
  450. </update>
  451. <!-- 校验物料版本是否存在-->
  452. <select id="queryPartRevision" parameterType="BomHeaderEntity" resultType="PartRevisionEntity">
  453. SELECT
  454. site,
  455. part_no,
  456. eng_chg_level,
  457. eff_phase_in_date,
  458. eff_phase_out_date,
  459. revision_text,
  460. product_status,
  461. repair_status,
  462. eng_revision,
  463. create_date,
  464. create_by,
  465. update_date,
  466. update_by
  467. FROM part_revision
  468. WHERE site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel}
  469. </select>
  470. <!-- 新增物料版本 -->
  471. <insert id="savePartRevision" parameterType="BomHeaderEntity">
  472. insert into part_revision (site, part_no, eng_chg_level, eff_phase_in_date, eff_phase_out_date, revision_text, product_status, repair_status, eng_revision, create_date, create_by)
  473. values (#{site}, #{partNo}, #{engChgLevel}, #{effPhaseInDate}, #{effPhaseOutDate}, #{noteText}, 'Not In Effect', 'Not In Effect', #{engRevision}, getDate(), #{createBy})
  474. </insert>
  475. <select id="queryBomDetailOfficialFlag" parameterType="BomComponentEntity" resultType="BomDetailEntity">
  476. SELECT
  477. site,
  478. part_no,
  479. bom_type,
  480. eng_chg_level,
  481. alternative_no,
  482. alternative_description,
  483. min_lot_qty,
  484. default_flag,
  485. note_text as detailNoteText,
  486. status,
  487. official_flag
  488. FROM plm_bom_detail
  489. where site = #{site} and part_no = #{partNo} and bom_type = #{bomType} and eng_chg_level = #{engChgLevel} and alternative_no = #{alternativeNo}
  490. </select>
  491. <!-- 获取 component 对象-->
  492. <select id="queryComponentPartFlag" parameterType="BomDetailEntity" resultType="PartInformationEntity">
  493. SELECT
  494. a.site,
  495. a.part_no,
  496. b.status
  497. FROM plm_bom_component as a
  498. LEFT JOIN part as b on a.site = b.site and a.component_part = b.part_no
  499. WHERE a.site = #{site} and a.part_no = #{partNo} and a.eng_chg_level = #{engChgLevel} and a.bom_type = #{bomType} and a.alternative_no = #{alternativeNo}
  500. </select>
  501. <select id="queryBomDetailEntityList" resultType="com.spring.modules.part.entity.BomDetailEntity">
  502. SELECT
  503. site,
  504. part_no,
  505. bom_type,
  506. eng_chg_level,
  507. alternative_no,
  508. alternative_description,
  509. status,
  510. min_lot_qty,
  511. default_flag,
  512. note_text as detailNoteText,
  513. official_flag
  514. FROM plm_bom_detail
  515. where site = #{site} and part_no = #{partNo}
  516. </select>
  517. <!-- 查询库位 -->
  518. <select id="selectLocation" parameterType="BomComponentEntity" resultType="LocationInformationEntity">
  519. SELECT
  520. site,
  521. location_id,
  522. location_name
  523. FROM view_location
  524. <where>
  525. site = #{site} AND location_id = #{issueToLoc}
  526. </where>
  527. </select>
  528. <!-- 查询part revision -->
  529. <select id="selectPartRevision" parameterType="BomDetailEntity" resultType="com.spring.modules.part.vo.PartRevisionVo">
  530. SELECT
  531. site,
  532. part_no,
  533. eng_chg_level,
  534. eff_phase_in_date,
  535. eff_phase_out_date,
  536. revision_text,
  537. product_status,
  538. repair_status,
  539. eng_revision
  540. FROM part_revision
  541. where site = #{site} AND part_no = #{partNo} and eng_chg_level = #{engChgLevel}
  542. </select>
  543. <!-- 修改revision状态 -->
  544. <update id="updatePartRevisionProductStatus" parameterType="com.spring.modules.part.vo.PartRevisionVo">
  545. update part_revision
  546. set product_status = #{productStatus},
  547. <if test = "bomType == 'Repair'">
  548. repair_status = 'In Effect',
  549. </if>
  550. update_date = getDate(),
  551. update_by = #{updateBy}
  552. where site = #{site} and part_no = #{partNo} and eng_chg_level = #{engChgLevel}
  553. </update>
  554. </mapper>