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.

46 lines
1.4 KiB

9 months ago
9 months ago
4 months ago
9 months ago
4 months ago
9 months ago
4 months ago
9 months ago
9 months 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.gaotao.modules.handlingunit.dao.HandlingUnitDetailMapper">
  4. <!-- 查询处理单元明细列表 -->
  5. <select id="selectDetailsByUnitId" resultType="com.gaotao.modules.handlingunit.entity.dto.HandlingUnitDetailDto">
  6. SELECT
  7. detail_id,
  8. site,
  9. unit_id,
  10. part_no,
  11. part_desc,
  12. qty,
  13. batch_no,
  14. serial_no,
  15. lot_no,
  16. order_ref1,
  17. order_ref2,
  18. order_ref3,
  19. supplier_id,
  20. customer_id,
  21. manufacture_date,
  22. expired_date,
  23. status,
  24. status_db,
  25. created_date,
  26. created_by,
  27. remark
  28. FROM handling_unit_detail WITH (NOLOCK)
  29. WHERE site = #{site} AND unit_id = #{unitId}
  30. AND status_db = 'A'
  31. ORDER BY created_date
  32. </select>
  33. <!-- 删除处理单元明细 -->
  34. <!-- 优化:添加 WITH (ROWLOCK) 避免锁升级导致死锁 - rqrq -->
  35. <update id="deleteDetailsByUnitId">
  36. UPDATE handling_unit_detail WITH (ROWLOCK)
  37. SET status = 'DELETED',
  38. status_db = 'D',
  39. modified_date = GETDATE()
  40. WHERE site = #{site} AND unit_id = #{unitId}
  41. </update>
  42. </mapper>