#
luxiaotao1123
2024-02-01 528d0da19f5fc3f5c78af3c99a1f2cfa914a27dd
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
<?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.common.wms.mapper.WrkMastMapper">
 
    <select id="selectToBeCompleteData" resultType="com.zy.asrs.common.wms.entity.WrkMast">
        select * from wms_wrk_mast where ((wrk_sts = 99 Or wrk_sts = 199 ) and io_type != 103 and io_type != 104 and io_type != 107 ) order by io_time,wrk_no
    </select>
 
    <select id="selectToBeHistoryData" resultType="com.zy.asrs.common.wms.entity.WrkMast">
        select * from wms_wrk_mast
        where wrk_sts=100
        or (wrk_sts=200 and ove_mk='Y' and wrk_no not in (select wrk_no from common_bas_devp where common_bas_devp.host_id = wms_wrk_mast.host_id))
        or (wrk_sts=200 and dateadd(mi,15,io_time) &lt;= getdate() and wrk_no not in (select wrk_no from common_bas_devp where common_bas_devp.host_id = wms_wrk_mast.host_id))
        or (wrk_sts=200 and io_time is null and wrk_no not in (select wrk_no from common_bas_devp where common_bas_devp.host_id = wms_wrk_mast.host_id))
        order by io_time,wrk_no asc
    </select>
 
    <select id="selectSameLevMatnrs" resultType="com.zy.asrs.common.wms.entity.WrkMast">
        select m.loc_no
        from wms_wrk_mast m,
             wms_wrk_detl d,
             common_loc_mast lm
        where m.id = d.wrk_mast_id
          and m.loc_no = lm.loc_no
          and m.host_id = lm.host_id
          and io_type = 1
          and wrk_sts &lt; 99
          and d.matnr = #{matnr}
          <if test="batch != null and batch != ''">
              and d.batch = #{batch}
          </if>
          <if test="hostId != null">
              and lm.host_id = #{hostId}
          </if>
          <if test="locRangeDto != null">
              <if test="locRangeDto.startRow">
                  and lm.row1 &gt;= #{locRangeDto.startRow}
              </if>
              <if test="locRangeDto.targetRow">
                  and lm.row1 &lt;= #{locRangeDto.targetRow}
              </if>
              <if test="locRangeDto.startBay">
                  and lm.bay1 &gt;= #{locRangeDto.startBay}
              </if>
              <if test="locRangeDto.targetBay">
                  and lm.bay1 &lt;= #{locRangeDto.targetBay}
              </if>
              <if test="locRangeDto.startLev">
                  and lm.lev1 &gt;= #{locRangeDto.startLev}
              </if>
              <if test="locRangeDto.targetLev">
                  and lm.lev1 &lt;= #{locRangeDto.targetLev}
              </if>
          </if>
        ORDER BY m.wrk_no desc;
    </select>
 
</mapper>