自动化立体仓库 - WMS系统
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
<?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.OrderPakoutLogMapper">
 
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.OrderPakoutLog">
        <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" />
        <result column="move_status" property="moveStatus" />
        <result column="pakin_pakout_status" property="pakinPakoutStatus" />
    </resultMap>
 
    <sql id="BaseColumnList">
        mol.id,
        mol.uuid,
        mol.order_no,
        mol.order_time,
        mol.doc_type,
        mol.item_id,
        mol.item_name,
        mol.allot_item_id,
        mol.def_number,
        mol.number,
        mol.cstmr,
        mol.cstmr_name,
        mol.tel,
        mol.oper_memb,
        mol.total_fee,
        mol.discount,
        mol.discount_fee,
        mol.other_fee,
        mol.act_fee,
        mol.pay_type,
        mol.salesman,
        mol.account_day,
        mol.post_fee_type,
        mol.post_fee,
        mol.pay_time,
        mol.send_time,
        mol.ship_name,
        mol.ship_code,
        mol.settle,
        mol.status,
        mol.create_by,
        mol.create_time,
        mol.update_by,
        mol.update_time,
        mol.memo,
        mol.move_status,
        mol.pakin_pakout_status
    </sql>
 
    <sql id="HistoryCondition">
        <if test="order_no != null and order_no != ''">
            and mol.order_no like '%' + #{order_no} + '%'
        </if>
        <if test="orderTime != null and orderTime != ''">
            and mol.order_time like '%' + #{orderTime} + '%'
        </if>
        <if test="doc_type != null and doc_type != ''">
            and mol.doc_type = #{doc_type}
        </if>
        <if test="settle != null and settle != ''">
            and mol.settle = #{settle}
        </if>
        <if test="move_status != null and move_status != ''">
            and mol.move_status = #{move_status}
        </if>
        <if test="createTimeStart != null and createTimeStart != ''">
            and mol.create_time &gt;= #{createTimeStart}
        </if>
        <if test="createTimeEnd != null and createTimeEnd != ''">
            and mol.create_time &lt;= #{createTimeEnd}
        </if>
        <if test="updateTimeStart != null and updateTimeStart != ''">
            and mol.update_time &gt;= #{updateTimeStart}
        </if>
        <if test="updateTimeEnd != null and updateTimeEnd != ''">
            and mol.update_time &lt;= #{updateTimeEnd}
        </if>
        <if test="memo != null and memo != ''">
            and mol.memo like '%' + #{memo} + '%'
        </if>
        <if test="condition != null and condition != ''">
            and (
                mol.order_no like '%' + #{condition} + '%'
                or mol.order_time like '%' + #{condition} + '%'
                or mol.cstmr_name like '%' + #{condition} + '%'
                or mol.memo like '%' + #{condition} + '%'
                or cast(mol.id as varchar) like '%' + #{condition} + '%'
            )
        </if>
    </sql>
 
    <select id="selectHistoryPage" parameterType="java.util.Map" resultMap="BaseResultMap">
        select * from
        (
            select
                ROW_NUMBER() over (order by mol.update_time desc, mol.create_time desc, mol.id desc) as row,
                <include refid="BaseColumnList" />
            from man_order_log_pakout mol
            where 1=1
            <include refid="HistoryCondition" />
        ) t
        where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
 
    <select id="selectHistoryPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
        select count(1)
        from man_order_log_pakout mol
        where 1=1
        <include refid="HistoryCondition" />
    </select>
 
    <select id="selectHistoryAll" parameterType="java.util.Map" resultMap="BaseResultMap">
        select
            <include refid="BaseColumnList" />
        from man_order_log_pakout mol
        where 1=1
        <include refid="HistoryCondition" />
        order by mol.update_time desc, mol.create_time desc, mol.id desc
    </select>
</mapper>