chengf
2026-03-25 1e0e62187e2b7ff3e1fef23b182a710dc8cd76f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?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>