2025-08-08 14:04:10 +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.WmsInventoryCheckTaskMapper">
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.InventoryCheckTaskVO">
|
|
|
|
|
select *
|
|
|
|
|
from wms_inventory_check_task
|
|
|
|
|
<where>
|
|
|
|
|
<if test="request.state!=null">
|
|
|
|
|
and state = #{request.state}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.startDate!=null">
|
|
|
|
|
and start_time >= #{request.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.endDate!=null">
|
|
|
|
|
and end_time <= #{request.endDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.no!=null and request.no!=''">
|
|
|
|
|
and task_no like concat('%', #{request.no}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-08-19 18:22:15 +08:00
|
|
|
<select id="getMatrials" resultType="com.nflg.wms.common.pojo.vo.InventoryCheckTaskItemMaterialVO">
|
2025-08-08 14:04:10 +08:00
|
|
|
SELECT ictim.*,di."name" AS "factory_no",wh."no" AS "warehouse_no",get_binnos(s.id) AS "bin_nos",i.num AS "inventory_num"
|
|
|
|
|
FROM wms_inventory_check_task_item_material ictim
|
|
|
|
|
LEFT JOIN wms_inventory_check_task_item icti ON ictim.item_id=icti."id"
|
|
|
|
|
LEFT JOIN wms_warehouse wh ON icti.warehouse_id=wh."id"
|
|
|
|
|
LEFT JOIN dictionary_item di ON di."id"=wh.factory_id
|
|
|
|
|
LEFT JOIN wms_inventory i ON ictim.material_no=i.material_no and i.factory_no=di.code AND i.warehouse_no=wh."no" AND i.batch_number=ictim.batch_no
|
|
|
|
|
LEFT JOIN wms_storage s ON s.material_no=ictim.material_no AND s.warehouse_id=icti.warehouse_id
|
|
|
|
|
WHERE ictim.task_id=#{request.taskId}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|