自动化立体仓库 - WMS系统
*
lsh
12 小时以前 33884a1e6e3126983ae944fff749fe6f9271c404
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?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.zy.asrs.mapper.OrderPakoutMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.OrderPakout">
        <id column="id" property="id" />
        <result column="uuid" property="uuid" />
        <result column="order_no" property="orderNo" />
        <result column="order_time" property="orderTime" />
        <result column="doc_type" property="docType" />
        <result column="item_id" property="itemId" />
        <result column="item_name" property="itemName" />
        <result column="allot_item_id" property="allotItemId" />
        <result column="def_number" property="defNumber" />
        <result column="number" property="number" />
        <result column="cstmr" property="cstmr" />
        <result column="cstmr_name" property="cstmrName" />
        <result column="tel" property="tel" />
        <result column="oper_memb" property="operMemb" />
        <result column="total_fee" property="totalFee" />
        <result column="discount" property="discount" />
        <result column="discount_fee" property="discountFee" />
        <result column="other_fee" property="otherFee" />
        <result column="act_fee" property="actFee" />
        <result column="pay_type" property="payType" />
        <result column="salesman" property="salesman" />
        <result column="account_day" property="accountDay" />
        <result column="post_fee_type" property="postFeeType" />
        <result column="post_fee" property="postFee" />
        <result column="pay_time" property="payTime" />
        <result column="send_time" property="sendTime" />
        <result column="ship_name" property="shipName" />
        <result column="ship_code" property="shipCode" />
        <result column="settle" property="settle" />
        <result column="status" property="status" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
 
    </resultMap>
 
    <!-- 主视图A的通用查询映射结果 -->
    <resultMap id="PakoutMainResultMap" type="com.zy.asrs.entity.result.OrderPakoutMainVo">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="item_name" property="itemName" jdbcType="VARCHAR"/>
        <result column="order_count" property="orderCount" jdbcType="INTEGER"/>
        <result column="uuid" property="uuid" jdbcType="VARCHAR"/>
        <result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
        <result column="order_time" property="orderTime" jdbcType="VARCHAR"/>
        <result column="doc_type" property="docType" jdbcType="BIGINT"/>
        <result column="item_id" property="itemId" jdbcType="BIGINT"/>
        <result column="allot_item_id" property="allotItemId" jdbcType="BIGINT"/>
        <result column="def_number" property="defNumber" jdbcType="VARCHAR"/>
        <result column="number" property="number" jdbcType="VARCHAR"/>
        <result column="cstmr" property="cstmr" jdbcType="BIGINT"/>
        <result column="cstmr_name" property="cstmrName" jdbcType="VARCHAR"/>
        <result column="tel" property="tel" jdbcType="VARCHAR"/>
        <result column="oper_memb" property="operMemb" jdbcType="VARCHAR"/>
        <result column="total_fee" property="totalFee" jdbcType="DECIMAL"/>
        <result column="discount" property="discount" jdbcType="DECIMAL"/>
        <result column="discount_fee" property="discountFee" jdbcType="DECIMAL"/>
        <result column="other_fee" property="otherFee" jdbcType="DECIMAL"/>
        <result column="act_fee" property="actFee" jdbcType="DECIMAL"/>
        <result column="pay_type" property="payType" jdbcType="INTEGER"/>
        <result column="salesman" property="salesman" jdbcType="VARCHAR"/>
        <result column="account_day" property="accountDay" jdbcType="INTEGER"/>
        <result column="post_fee_type" property="postFeeType" jdbcType="INTEGER"/>
        <result column="post_fee" property="postFee" jdbcType="DECIMAL"/>
        <result column="pay_time" property="payTime" jdbcType="TIMESTAMP"/>
        <result column="send_time" property="sendTime" jdbcType="TIMESTAMP"/>
        <result column="ship_name" property="shipName" jdbcType="VARCHAR"/>
        <result column="ship_code" property="shipCode" jdbcType="VARCHAR"/>
        <result column="settle" property="settle" jdbcType="BIGINT"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="create_by" property="createBy" jdbcType="BIGINT"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_by" property="updateBy" jdbcType="BIGINT"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="memo" property="memo" jdbcType="VARCHAR"/>
    </resultMap>
 
    <update id="updateSettle">
        update man_order_pakout
        set settle = #{settle}
        ,update_time = getdate()
        <if test="userId != null">
            ,update_by = #{userId}
        </if>
        where 1=1
        and id = #{orderId}
    </update>
 
    <select id="selectComplete" resultMap="BaseResultMap">
        select top 5 *
        from man_order_pakout
        where 1=1
        and settle = 4
        and status = 1
        order by create_time asc
    </select>
 
    <select id="selectSettle" resultMap="BaseResultMap">
        select top 5 *
        from man_order_pakout
        where 1=1
          and settle =  #{settle}
          and status = 1
        order by create_time asc
    </select>
 
    <insert id="addToLogTable">
        INSERT INTO man_order_pakout_log SELECT * FROM man_order_pakout WHERE id = #{id}
    </insert>
 
    <select id="selectorderNoL" resultMap="BaseResultMap">
        select *
        from man_order_pakout
        where 1=1
        <if test="orderNo != null">
            and order_no = #{orderNo}
        </if>
    </select>
 
    <select id="selectorderNoLT" resultMap="BaseResultMap">
        select *
        from man_order_pakout
        where 1=1
        <if test="orderNo != null">
            and order_no = #{orderNo}
        </if>
    </select>
 
    <update id="removeGroupGoodsNoUpdate">
        update man_order_pakout
        set settle = 99
        ,update_time = getdate()
        where 1=1
        and item_name = #{itemName}
        and order_no != #{orderNo}
        and (settle = 10 or settle = 98)
    </update>
 
    <select id="selectOrderPakoutMainVoList" resultMap="PakoutMainResultMap">
        SELECT * FROM v_pakout_main
        WHERE status = 1
        <if test="itemName != null and itemName != ''">
            AND item_name LIKE CONCAT('%', #{itemName}, '%')
        </if>
        <if test="cstmrName != null and cstmrName != ''">
            AND cstmr_name LIKE CONCAT('%', #{cstmrName}, '%')
        </if>
        <if test="settle != null and settle != ''">
            AND settle = #{settle}
        </if>
        <if test="status != null and status != ''">
            AND status = #{status}
        </if>
        ORDER BY create_time DESC
    </select>
 
    <select id="selectOrderPakoutMainVoListTotal" resultType="Long">
        SELECT count(1) FROM v_pakout_main
        WHERE status = 1
        <if test="itemName != null and itemName != ''">
            AND item_name LIKE CONCAT('%', #{itemName}, '%')
        </if>
        <if test="cstmrName != null and cstmrName != ''">
            AND cstmr_name LIKE CONCAT('%', #{cstmrName}, '%')
        </if>
        <if test="settle != null and settle != ''">
            AND settle = #{settle}
        </if>
        <if test="status != null and status != ''">
            AND status = #{status}
        </if>
    </select>
 
</mapper>