<?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="purchaseReceiveServiceDaoImpl">
|
|
<!-- 保存采购收货信息 add by system 2026-03-25 -->
|
<insert id="savePurchaseReceiveInfo" parameterType="Map">
|
insert into purchase_receive(id, apply_order_id, receive_quantity, receive_date, receive_address,
|
signer, stock_in_no, stock_in_date, stock_out_no, stock_out_date)
|
values (#{id}, #{applyOrderId}, #{receiveQuantity}, #{receiveDate}, #{receiveAddress},
|
#{signer}, #{stockInNo}, #{stockInDate}, #{stockOutNo}, #{stockOutDate})
|
</insert>
|
|
<!-- 查询采购收货信息 add by system 2026-03-25 -->
|
<select id="getPurchaseReceiveInfo" parameterType="Map" resultType="Map">
|
select t.id,
|
t.apply_order_id,
|
t.apply_order_id applyOrderId,
|
t.receive_quantity,
|
t.receive_quantity receiveQuantity,
|
t.receive_date,
|
t.receive_date receiveDate,
|
t.receive_address,
|
t.receive_address receiveAddress,
|
t.signer,
|
t.stock_in_no,
|
t.stock_in_no stockInNo,
|
t.stock_in_date,
|
t.stock_in_date stockInDate,
|
t.stock_out_no,
|
t.stock_out_no stockOutNo,
|
t.stock_out_date,
|
t.stock_out_date stockOutDate
|
from purchase_receive t
|
where 1 =1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
<if test="receiveQuantity !=null and receiveQuantity != ''">
|
and t.receive_quantity= #{receiveQuantity}
|
</if>
|
<if test="receiveDate !=null and receiveDate != ''">
|
and t.receive_date= #{receiveDate}
|
</if>
|
<if test="receiveAddress !=null and receiveAddress != ''">
|
and t.receive_address= #{receiveAddress}
|
</if>
|
<if test="signer !=null and signer != ''">
|
and t.signer= #{signer}
|
</if>
|
<if test="stockInNo !=null and stockInNo != ''">
|
and t.stock_in_no= #{stockInNo}
|
</if>
|
<if test="stockInDate !=null and stockInDate != ''">
|
and t.stock_in_date= #{stockInDate}
|
</if>
|
<if test="stockOutNo !=null and stockOutNo != ''">
|
and t.stock_out_no= #{stockOutNo}
|
</if>
|
<if test="stockOutDate !=null and stockOutDate != ''">
|
and t.stock_out_date= #{stockOutDate}
|
</if>
|
order by t.id desc
|
<if test="page != -1 and page != null ">
|
limit #{page}, #{row}
|
</if>
|
</select>
|
|
<!-- 修改采购收货信息 add by system 2026-03-25 -->
|
<update id="updatePurchaseReceiveInfo" parameterType="Map">
|
update purchase_receive t set
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
t.apply_order_id= #{applyOrderId},
|
</if>
|
<if test="receiveQuantity !=null and receiveQuantity != ''">
|
t.receive_quantity= #{receiveQuantity},
|
</if>
|
<if test="receiveDate !=null and receiveDate != ''">
|
t.receive_date= #{receiveDate},
|
</if>
|
<if test="receiveAddress !=null and receiveAddress != ''">
|
t.receive_address= #{receiveAddress},
|
</if>
|
<if test="signer !=null and signer != ''">
|
t.signer= #{signer},
|
</if>
|
<if test="stockInNo !=null and stockInNo != ''">
|
t.stock_in_no= #{stockInNo},
|
</if>
|
<if test="stockInDate !=null and stockInDate != ''">
|
t.stock_in_date= #{stockInDate},
|
</if>
|
<if test="stockOutNo !=null and stockOutNo != ''">
|
t.stock_out_no= #{stockOutNo},
|
</if>
|
<if test="stockOutDate !=null and stockOutDate != ''">
|
t.stock_out_date= #{stockOutDate}
|
</if>
|
where 1=1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
</update>
|
|
<!-- 查询采购收货数量 add by system 2026-03-25 -->
|
<select id="queryPurchaseReceivesCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from purchase_receive t
|
where 1 =1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="applyOrderId !=null and applyOrderId != ''">
|
and t.apply_order_id= #{applyOrderId}
|
</if>
|
<if test="receiveQuantity !=null and receiveQuantity != ''">
|
and t.receive_quantity= #{receiveQuantity}
|
</if>
|
<if test="receiveDate !=null and receiveDate != ''">
|
and t.receive_date= #{receiveDate}
|
</if>
|
<if test="receiveAddress !=null and receiveAddress != ''">
|
and t.receive_address= #{receiveAddress}
|
</if>
|
<if test="signer !=null and signer != ''">
|
and t.signer= #{signer}
|
</if>
|
<if test="stockInNo !=null and stockInNo != ''">
|
and t.stock_in_no= #{stockInNo}
|
</if>
|
<if test="stockInDate !=null and stockInDate != ''">
|
and t.stock_in_date= #{stockInDate}
|
</if>
|
<if test="stockOutNo !=null and stockOutNo != ''">
|
and t.stock_out_no= #{stockOutNo}
|
</if>
|
<if test="stockOutDate !=null and stockOutDate != ''">
|
and t.stock_out_date= #{stockOutDate}
|
</if>
|
</select>
|
|
</mapper>
|