#
Junjie
2023-12-28 30fd349a0bdec5f88021161d20263c4bee5dba11
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
<?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.OrderDetlMapper">
 
    <sql id="pakOutPageCondition">
        <if test="map.order_id!=null and map.order_id!='' ">
            and mod.order_id = #{map.order_id}
        </if>
        <if test="map.matnr!=null and map.matnr!='' ">
            and mod.matnr = #{map.matnr}
        </if>
        <if test="map.maktx!=null and map.maktx!='' ">
            and mod.maktx = #{map.maktx}
        </if>
        <if test="map.batch!=null and map.batch!='' ">
            and mod.batch = #{map.batch}
        </if>
    </sql>
 
    <select id="selectItem" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select * from wms_order_detl
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </select>
 
    <select id="getPakoutPage" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select
        mod.*
        from wms_order_detl mod
        inner join wms_order mo on mod.order_id = mo.id
        inner join wms_doc_type mdt on mo.doc_type = mdt.doc_id
        where 1=1
        and mo.settle &lt;= 2
        and mo.status = 1
        and mdt.pakout = 1
        <include refid="pakOutPageCondition"></include>
    </select>
 
</mapper>