2025-08-22 18:24:08 +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.WmsPoReceiptMapper">
|
|
|
|
|
<select id="checkItemStatus" resultType="java.lang.Long">
|
|
|
|
|
select id
|
|
|
|
|
from wms_po_receipt_item
|
|
|
|
|
where receive_id = #{taskId}
|
|
|
|
|
and in_qty != receipt_num
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.POReceiptVO">
|
|
|
|
|
select
|
|
|
|
|
a.id,a.in_num,b.note_num,b.ou_code,b.iu_code,b.purchase_group,b.delivery_note_date,
|
|
|
|
|
b.waybill_num,
|
|
|
|
|
c.supplier_name,b.supplier_num,
|
|
|
|
|
a.is_completed,a.create_time as receive_time,
|
|
|
|
|
a.update_time as in_time, a.create_user_name as receive_user_name,
|
|
|
|
|
a.update_user_name as in_user_name from wms_po_receipt a left join
|
|
|
|
|
wms_srm_order b on a.order_no=b.note_num
|
|
|
|
|
left join user_supplier c on b.supplier_num=c.supplier_code
|
2025-08-24 11:18:30 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="request.inNum !=null and request.inNum !='' ">
|
|
|
|
|
and a.in_num like concat('%', #{request.inNum}, '%')
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.orderNo !=null and request.orderNo !='' ">
|
|
|
|
|
and b.note_num like concat('%', #{request.orderNo}, '%')
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.supplierNum !=null and request.supplierNum !='' ">
|
|
|
|
|
and b.supplier_num =#{request.supplierNum}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
|
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.itemCode !=null and request.itemCode !='' ">
|
|
|
|
|
and EXISTS (select 1 from wms_srm_order_item where a.id=wms_srm_order_item.order_id and
|
|
|
|
|
wms_srm_order_item.item_code like concat('%', #{request.itemCode}, '%')
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.receiveStartDate !=null and request.receiveStartDate !='' ">
|
|
|
|
|
and a.create_time >= #{request.receiveStartDate}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.receiveEndDate !=null and request.receiveEndDate !='' ">
|
|
|
|
|
and a.create_time < #{request.receiveEndDate}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.deliveryStartDate !=null and request.deliveryStartDate !='' ">
|
|
|
|
|
and a.delivery_note_date >= #{request.deliveryStartDate}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.deliveryEndDate !=null and request.deliveryEndDate !='' ">
|
|
|
|
|
and a.delivery_note_date < #{request.deliveryEndDate}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.inStartDate !=null and request.inStartDate !='' ">
|
|
|
|
|
and a.update_time >= #{request.inStartDate}
|
|
|
|
|
</if>
|
2025-08-22 18:24:08 +08:00
|
|
|
|
2025-08-24 11:18:30 +08:00
|
|
|
<if test="request.inEndDate !=null and request.inEndDate !='' ">
|
|
|
|
|
and a.update_time < #{request.inEndDate}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
2025-08-22 18:24:08 +08:00
|
|
|
order by a.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|