自动化立体仓库 - WCS系统
*
lsh
2025-04-03 0134bfa28a0583c0f2b28e52a6c0aeee7098ecf9
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
<?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.WrkMastStaMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMastSta">
        <id column="ID" property="id" />
        <result column="WRK_NO" property="wrkNo" />
        <result column="WRK_START" property="wrkStart" />
        <result column="WRK_END" property="wrkEnd" />
        <result column="STA_START" property="staStart" />
        <result column="STA_END" property="staEnd" />
        <result column="CREATE_TIME" property="createTime" />
        <result column="UPDATE_TIME" property="updateTime" />
        <result column="TYPE" property="type" />
        <result column="WRK_STS" property="wrkSts" />
        <result column="LINE_NUMBER" property="lineNumber" />
        <result column="WRK_TYPE" property="wrkType" />
        <result column="WRK_CRN" property="wrkCrn" />
        <result column="BIGN_TIME" property="bignTime" />
 
    </resultMap>
 
    <select id="selectAllWrkMastStaList" resultMap="BaseResultMap">
        select * from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        and WRK_STS=0
        <if test="type!=null">
            and TYPE = #{type}
        </if>
        order by LINE_NUMBER,ID
    </select>
 
    <select id="selectByWrkNo" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        and WRK_NO = #{workNo}
    </select>
 
    <select id="selectNoInterfere" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        and (STA_START in
        <foreach item="item" collection="staStarts" index="index" separator="," open="(" close=")">
            #{item}
        </foreach>
        or STA_START = 0
        )
        and (STA_END in
        <foreach item="item" collection="staEnds" index="index" separator="," open="(" close=")">
            #{item}
        </foreach>
        or STA_END = 0
        )
        and WRK_STS=0
        order by LINE_NUMBER,ID
    </select>
 
    <select id="selectNoInterfereList" resultMap="BaseResultMap">
        select * from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        and (STA_START in
        <foreach item="item" collection="staStarts" index="index" separator="," open="(" close=")">
            #{item}
        </foreach>
        or STA_START = 0
        )
        and (STA_END in
        <foreach item="item" collection="staEnds" index="index" separator="," open="(" close=")">
            #{item}
        </foreach>
        or STA_END = 0
        )
        and WRK_STS=0
        order by LINE_NUMBER,ID
    </select>
 
    <select id="selectAllWrkCount" resultType="Integer">
        select count(1) from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        <if test="type!=null">
            and TYPE = #{type}
        </if>
    </select>
 
    <select id="selectAllWrkCount108" resultType="Integer">
        select count(1) from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        and TYPE = 1
        and (STA_END = 108 or STA_START = 108)
    </select>
 
    <select id="selectAllWrkCount108Y" resultType="Integer">
        select count(1) from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
--         and type = 1
        and ((STA_END &lt;= 108 or STA_START &lt;= 108)
        or (STA_END = 118 or STA_START = 118)
        or (STA_END = 122 or STA_START = 122))
    </select>
 
    <select id="selectAllWrkStsCount" resultType="Integer">
        select count(1) from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        <if test="type!=null">
            and TYPE = #{type}
        </if>
        <if test="wrkSts!=null">
            and WRK_STS = #{wrkSts}
        </if>
    </select>
 
    <select id="selectAllWrkStsCountWrkMastSta" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."asr_wrk_mast_sta"
        where 1=1
        <if test="type!=null">
            and TYPE = #{type}
        </if>
        <if test="wrkSts!=null">
            and WRK_STS = #{wrkSts}
        </if>
    </select>
 
 
 
 
</mapper>