WStorageLocationDao.xml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.imcs.admin.business.dao.WStorageLocationManagementDao">
  4. <select id="getShelfManagement" parameterType="String" resultType="com.imcs.admin.entity.WShelfManagement">
  5. select shelf.* from w_storage_location_management loca
  6. left join w_shelf_management shelf on loca.shelf_management_id=shelf.id
  7. where loca.location_code = #{endPosition}
  8. </select>
  9. <select id="getSubStorage" resultType="com.imcs.admin.entity.WStorageLocationManagement">
  10. select * from w_storage_location_management
  11. where (parent_id=(select id from w_storage_location_management where location_code=#{locationCode})
  12. or location_code=#{locationCode}) and storage_location_status != 1
  13. </select>
  14. <update id="updateByLocationCode" >
  15. update w_storage_location_management set storage_location_status=#{status} where location_code=#{locationCode};
  16. </update>
  17. <update id="updateByParentId">
  18. update w_storage_location_management set storage_location_status=#{status} where parent_id=#{parentId};
  19. </update>
  20. <update id="updateStatusById">
  21. update w_storage_location_management set storage_location_status=#{status}
  22. where id = #{id}
  23. </update>
  24. <select id="getAllByLocationCode" resultType="com.imcs.admin.entity.WStorageLocationManagement" parameterType="com.imcs.admin.entity.WInventoryManagement">
  25. select loca.*,inv.pallet_code as palletCode from w_storage_location_management loca
  26. left join w_inventory_management inv on loca.location_code=inv.storage_location_code
  27. where loca.location_code in
  28. <foreach close=")" collection="list" item="id" open="(" separator=",">
  29. #{id.palletCode}
  30. </foreach>
  31. </select>
  32. <select id="selectListByShelfCode" resultType="com.imcs.admin.entity.WStorageLocationManagement">
  33. select * from w_storage_location_management where shelf_management_id=(select id from w_shelf_management where shelf_code=#{shelfCode})
  34. </select>
  35. <select id="getStorageLocationRatio" resultType="com.imcs.admin.entity.WStorageLocationManagement">
  36. SELECT
  37. COUNT(*) pallet_type,
  38. wslm.storage_location_status
  39. FROM
  40. w_warehouse_management wwm
  41. LEFT JOIN w_shelf_management wsm ON wwm.id = wsm.warehouse_management_id
  42. LEFT JOIN w_storage_location_management wslm ON wsm.id = wslm.shelf_management_id
  43. WHERE
  44. wwm.warehouse_status = 2
  45. AND wsm.shelf_status = 2
  46. AND wslm.parent_id IS NULL
  47. GROUP BY
  48. wslm.storage_location_status
  49. </select>
  50. <select id="getLibraryLocationUsage" resultType="com.imcs.admin.entity.assemble.WStorageLocationGroup">
  51. SELECT
  52. COUNT( wslm.location_code ) numbers,
  53. wslm.storage_location_status,
  54. wslm.pallet_Type,
  55. wsm.shelf_code ,
  56. wwm.warehouse_code
  57. FROM
  58. w_storage_location_management wslm
  59. LEFT JOIN w_shelf_management wsm ON wslm.shelf_management_id = wsm.id
  60. LEFT JOIN w_warehouse_management wwm ON wwm.id = wsm.warehouse_management_id
  61. GROUP BY
  62. wslm.storage_location_status,
  63. wslm.pallet_Type,
  64. wsm.id
  65. </select>
  66. <select id="getStorageLocation" resultType="com.imcs.admin.entity.WStorageLocationManagement">
  67. select * from w_storage_location_management where point=#{point}
  68. </select>
  69. <update id="updateStatusByParentId">
  70. update w_storage_location_management set storage_location_status=#{status} where parent_id=#{parentId}
  71. and not exists( select count(*) from w_storage_location_management where parent_id=#{parentId} and status in ());
  72. </update>
  73. <select id="selectOtherStorage" resultType="com.imcs.admin.entity.WStorageLocationManagement">
  74. select * from w_storage_location_management where parent_id=#{parentId} and storage_location_code!={storageLocationCode}
  75. </select>
  76. </mapper>