自动化立体仓库 - WMS系统
luxiaotao1123
2021-08-26 37286cd9b177e9a1b8f28bfbc054c8cfedec6a5e
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
<?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.ints.mapper.WaitMatinMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.ints.entity.WaitMatin">
        <result column="bill_no" property="billNo" />
        <result column="seq_no" property="seqNo" />
        <result column="bill_type" property="billType" />
        <result column="mat_no" property="matNo" />
        <result column="mat_name" property="matName" />
        <result column="qty" property="qty" />
        <result column="specs" property="specs" />
        <result column="unit" property="unit" />
        <result column="size" property="size" />
        <result column="color" property="color" />
        <result column="weight" property="weight" />
        <result column="memo" property="memo" />
        <result column="in_qty" property="inQty" />
        <result column="link_erp" property="linkErp" />
        <result column="io_status" property="ioStatus" />
        <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" />
 
    </resultMap>
 
    <sql id="condition">
        <if test="loc_no!=null and loc_no!='' ">
            and a.loc_no like '%' + #{loc_no} + '%'
        </if>
        <if test="mat_no!=null and mat_no!='' ">
            and a.mat_no like '%' + #{mat_no} + '%'
        </if>
        <if test="mat_name!=null and mat_name!='' ">
            and a.mat_name like '%' + #{mat_name} + '%'
        </if>
        <if test="qty!=null and qty!='' ">
            and a.qty = #{qty}
        </if>
        <if test="altme!=null and altme!='' ">
            and a.unit like '%' + #{unit} + '%'
        </if>
        <if test="startTime!=null and endTime!=null">
            and a.modi_time between #{startTime} and #{endTime}
        </if>
    </sql>
 
    <select id="getHeadPage" resultMap="BaseResultMap">
        select * from
        (
        select distinct bill_no, bill_type, appe_time,
        ROW_NUMBER() over (order by appe_time) as row
        from ints_wait_matin
        <include refid="condition"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
 
    <select id="getHeadPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
        select count(1) from
        (
        select distinct bill_no, bill_type, appe_time,
        ROW_NUMBER() over (order by appe_time) as row
        from ints_wait_matin
        <include refid="condition"></include>
        ) t
    </select>
 
</mapper>