12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.imcs.admin.business.dao.WStorageLocationManagementDao">
- <select id="getShelfManagement" parameterType="String" resultType="com.imcs.admin.entity.WShelfManagement">
- select shelf.* from w_storage_location_management loca
- left join w_shelf_management shelf on loca.shelf_management_id=shelf.id
- where loca.location_code = #{endPosition}
- </select>
- <select id="getSubStorage" resultType="com.imcs.admin.entity.WStorageLocationManagement">
- select * from w_storage_location_management
- where (parent_id=(select id from w_storage_location_management where location_code=#{locationCode})
- or location_code=#{locationCode}) and storage_location_status != 1
- </select>
- <update id="updateByLocationCode" >
- update w_storage_location_management set storage_location_status=#{status} where location_code=#{locationCode};
- </update>
- <update id="updateByParentId">
- update w_storage_location_management set storage_location_status=#{status} where parent_id=#{parentId};
- </update>
- <update id="updateStatusById">
- update w_storage_location_management set storage_location_status=#{status}
- where id = #{id}
- </update>
- <select id="getAllByLocationCode" resultType="com.imcs.admin.entity.WStorageLocationManagement" parameterType="com.imcs.admin.entity.WInventoryManagement">
- select loca.*,inv.pallet_code as palletCode from w_storage_location_management loca
- left join w_inventory_management inv on loca.location_code=inv.storage_location_code
- where loca.location_code in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id.palletCode}
- </foreach>
- </select>
- <select id="selectListByShelfCode" resultType="com.imcs.admin.entity.WStorageLocationManagement">
- select * from w_storage_location_management where shelf_management_id=(select id from w_shelf_management where shelf_code=#{shelfCode})
- </select>
- <select id="getStorageLocationRatio" resultType="com.imcs.admin.entity.WStorageLocationManagement">
- SELECT
- COUNT(*) pallet_type,
- wslm.storage_location_status
- FROM
- w_warehouse_management wwm
- LEFT JOIN w_shelf_management wsm ON wwm.id = wsm.warehouse_management_id
- LEFT JOIN w_storage_location_management wslm ON wsm.id = wslm.shelf_management_id
- WHERE
- wwm.warehouse_status = 2
- AND wsm.shelf_status = 2
- AND wslm.parent_id IS NULL
- GROUP BY
- wslm.storage_location_status
- </select>
- <select id="getLibraryLocationUsage" resultType="com.imcs.admin.entity.assemble.WStorageLocationGroup">
- SELECT
- COUNT( wslm.location_code ) numbers,
- wslm.storage_location_status,
- wslm.pallet_Type,
- wsm.shelf_code ,
- wwm.warehouse_code
- FROM
- w_storage_location_management wslm
- LEFT JOIN w_shelf_management wsm ON wslm.shelf_management_id = wsm.id
- LEFT JOIN w_warehouse_management wwm ON wwm.id = wsm.warehouse_management_id
- GROUP BY
- wslm.storage_location_status,
- wslm.pallet_Type,
- wsm.id
- </select>
- <select id="getStorageLocation" resultType="com.imcs.admin.entity.WStorageLocationManagement">
- select * from w_storage_location_management where point=#{point}
- </select>
- <update id="updateStatusByParentId">
- update w_storage_location_management set storage_location_status=#{status} where parent_id=#{parentId}
- and not exists( select count(*) from w_storage_location_management where parent_id=#{parentId} and status in ());
- </update>
- <select id="selectOtherStorage" resultType="com.imcs.admin.entity.WStorageLocationManagement">
- select * from w_storage_location_management where parent_id=#{parentId} and storage_location_code!={storageLocationCode}
- </select>
- </mapper>
|