2025-07-02 14:20:32 +08:00
|
|
|
<?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.nflg.wms.repository.mapper.WmsBinMapper">
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.BinVO">
|
|
|
|
|
select *, wh.no as warehouse_no, wh.name as warehouse_name
|
|
|
|
|
from wms_bin bin
|
|
|
|
|
left join wms_warehouse wh on bin.warehouse_id=wh.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="request.warehouseId != null">
|
2025-07-11 18:45:43 +08:00
|
|
|
and bin.warehouse_id=#{request.warehouseId}
|
2025-07-02 14:20:32 +08:00
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by bin.id desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getList" resultType="com.nflg.wms.common.pojo.vo.BinVO">
|
|
|
|
|
select *, wh.no as warehouse_no, wh.name as warehouse_name
|
|
|
|
|
from wms_bin bin
|
|
|
|
|
left join wms_warehouse wh on bin.warehouse_id=wh.id
|
|
|
|
|
where bin.id in
|
|
|
|
|
<foreach item="item" collection="ids" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
2025-09-26 18:04:00 +08:00
|
|
|
order by bin.id desc
|
2025-07-02 14:20:32 +08:00
|
|
|
</select>
|
2025-07-16 11:13:56 +08:00
|
|
|
|
|
|
|
|
<select id="searchNonPage" resultType="com.nflg.wms.common.pojo.vo.BinVO">
|
|
|
|
|
select *, wh.no as warehouse_no, wh.name as warehouse_name
|
|
|
|
|
from wms_bin bin
|
|
|
|
|
left join wms_warehouse wh on bin.warehouse_id=wh.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="request.warehouseId != null">
|
|
|
|
|
and bin.warehouse_id=#{request.warehouseId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by bin.id desc
|
|
|
|
|
</select>
|
2025-12-01 13:55:46 +08:00
|
|
|
|
|
|
|
|
<select id="getInventory" resultType="com.nflg.wms.common.pojo.vo.BinInventoryVO">
|
|
|
|
|
SELECT b."no",COALESCE(SUM(i.num),0)
|
|
|
|
|
FROM wms_bin b
|
|
|
|
|
LEFT JOIN wms_storage_bin sb ON sb.bin_id=b."id"
|
|
|
|
|
LEFT JOIN wms_storage s ON s."id"=sb.storage_id
|
|
|
|
|
LEFT JOIN wms_inventory i ON s.material_no=i.material_no
|
|
|
|
|
WHERE b.warehouse_id = #{warehouseId}
|
|
|
|
|
GROUP BY b."no"
|
|
|
|
|
ORDER BY b."no"
|
|
|
|
|
</select>
|
2025-07-02 14:20:32 +08:00
|
|
|
</mapper>
|