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.

53 lines
2.3 KiB

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.pms.mapper.PartSpareLocationMapper">
  4. <select id="getPartSpareLocation" resultType="com.xujie.sys.modules.pms.entity.PartSpareLocationVoData">
  5. select
  6. a.site,
  7. a.location_id,
  8. a.location_name,
  9. a.warehouse_id,
  10. dbo.getWarehouseName(a.site, a.warehouse_id) as warehouseName,
  11. a.max_capacity,
  12. a.active,
  13. a.create_date,
  14. a.create_by,
  15. a.update_date,
  16. a.update_by,
  17. a.bu_no,
  18. dbo.get_bu_desc(A.site, A.bu_no) buDesc
  19. from part_spare_location a
  20. <where>
  21. A.site in (select site from eam_access_site where username = #{query.username})
  22. and (A.site + '-' + A.bu_no) in (select * from dbo.query_bu(#{query.username}))
  23. <if test="query.buDesc != null and query.buDesc != ''">
  24. AND dbo.get_bu_desc (a.site, a.bu_no) = #{query.buDesc}
  25. </if>
  26. <if test="query.locationId != null and query.locationId != ''">
  27. and a.location_id like '%' +#{query.locationId}+'%'
  28. </if>
  29. <if test="query.locationName != null and query.locationName != ''">
  30. and a.location_name like '%' +#{query.locationName}+'%'
  31. </if>
  32. <if test="query.active != null and query.active != ''">
  33. and a.active = #{query.active}
  34. </if>
  35. <if test="query.warehouseId != null and query.warehouseId != ''">
  36. and a.warehouse_id = #{query.warehouseId}
  37. </if>
  38. </where>
  39. </select>
  40. <update id="updatePartSpareLocation" parameterType="com.xujie.sys.modules.pms.entity.vo.PartSpareLocationVo">
  41. UPDATE part_spare_location
  42. SET location_name = #{locationName},
  43. warehouse_id = #{warehouseId},
  44. max_capacity = #{maxCapacity,jdbcType=INTEGER},
  45. active = #{active},
  46. update_date = getDate(),
  47. update_by = #{updateBy}
  48. WHERE site = #{site} and bu_no = #{buNo} and location_id = #{locationId}
  49. </update>
  50. </mapper>