自动化立体仓库 - WCS系统
#
Junjie
2025-04-10 1d624dfdb040825ffecba6c792c480be662b2dbc
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
<?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.WrkMastMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMast">
        <id column="wrk_no" property="wrkNo" />
        <result column="mk" property="mk" />
        <result column="wrk_sts" property="wrkSts" />
        <result column="io_type" property="ioType" />
        <result column="io_pri" property="ioPri" />
        <result column="loc_no" property="locNo" />
        <result column="sta_no" property="staNo" />
        <result column="source_sta_no" property="sourceStaNo" />
        <result column="source_loc_no" property="sourceLocNo" />
        <result column="io_time" property="ioTime" />
        <result column="modi_user" property="modiUser" />
        <result column="modi_time" property="modiTime" />
        <result column="appe_user" property="appeUser" />
        <result column="appe_time" property="appeTime" />
        <result column="error_time" property="errorTime" />
        <result column="error_memo" property="errorMemo" />
        <result column="memo" property="memo" />
        <result column="barcode" property="barcode" />
        <result column="shuttle_no" property="shuttleNo" />
        <result column="lift_no" property="liftNo" />
        <result column="wms_wrk_no" property="wmsWrkNo" />
        <result column="system_msg" property="systemMsg" />
 
    </resultMap>
 
    <select id="selectPakInStep1" resultMap="BaseResultMap">
        select * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC limit 0,1
    </select>
 
    <select id="selectPakInStep11" resultMap="BaseResultMap">
        select * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=1 and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC limit 0,1
    </select>
 
    <select id="selectInStep4" resultMap="BaseResultMap">
        select *
        from asr_wrk_mast
        where 1=1
        and wrk_sts = 4
        and io_type in (1,10,53,57)
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectByWorkNo" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_no=#{workNo}
        limit 0,1
    </select>
 
    <select id="selectLiftStep223103" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
        and wrk_sts in (2,103,303)
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectByWorkNo324104" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_no=#{workNo}
        and wrk_sts in (3,104,303,306)
        limit 0,1
    </select>
 
    <select id="selectBy2125" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_sts in (101,105)
        and io_type in (101,103,107,110)
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectNoShuttleWrkByLev" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where shuttle_no is null
        and ((wrk_sts = 2 and loc_no like #{lev}) or (wrk_sts = 101 and source_loc_no like #{lev}))
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectShuttleWrkByLev" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where shuttle_no is not null
        and ((wrk_sts not in (9,10)  and loc_no like #{lev}) or (wrk_sts not in (29,30) and source_loc_no like #{lev}))
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectShuttleOutWrkByLev" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where shuttle_no is not null
        and (wrk_sts not in (109,110) and source_loc_no like #{lev})
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectLiftWrkMast" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where lift_no = #{liftNo}
        and wrk_sts in (3,4,104,105,301,302,303,304,305,306,307,308,309)
        limit 0,1
    </select>
 
    <select id="selectLocToLocWrkMast" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where io_type in (11)
        and wrk_sts not in (9,10,109,110)
        order by io_pri desc,wrk_sts desc
    </select>
 
    <select id="selectPickStepByBarcode" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where io_type in (53,103,107)
        and wrk_sts in (2,3,104,109)
        and barcode = #{barcode}
        order by io_pri desc,wrk_sts desc
        limit 0,1
    </select>
 
    <select id="selectShuttleHasMoveWorking" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
        and shuttle_no = #{shuttleNo}
        and wrk_sts not in (311)
        and io_type = 200
        order by io_pri desc,io_time,wrk_no asc
        limit 0,1
    </select>
 
    <select id="selectShuttleMoveWrk" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
--         and wrk_sts in (301,302,303,304,305,306,307,308,309,310,311)
        and io_type = 200
        order by io_pri desc,io_time,wrk_no asc
    </select>
 
    <select id="selectShuttleWorking" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
        and shuttle_no = #{shuttleNo}
        and wrk_sts not in (9,10,109,110,210)
        and io_type not in (200,300)
        order by io_pri desc,io_time,wrk_no asc
        limit 0,1
    </select>
 
    <select id="selectByBarcode" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
        and barcode = #{barcode}
        order by io_pri desc,io_time,wrk_no asc
        limit 0,1
    </select>
 
    <select id="selectInWrkMastByLiftNo" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where 1=1
        and lift_no = #{liftNo}
        and io_type &lt;= 100
        and wrk_sts in (1,2,3,4,5)
        order by io_pri desc,io_time,wrk_no asc
    </select>
 
    <select id="selectChargeWorking" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where io_type in (300)
        and shuttle_no = #{shuttleNo}
        order by io_pri desc,io_time,wrk_no asc
    </select>
 
    <select id="selectChargeWorkingByChargeSta" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_sts in (201,202,203,204,205,210)
        and mk = #{chargeSta}
        order by io_pri desc,io_time,wrk_no asc
    </select>
 
</mapper>