自动化立体仓库 - WMS系统
#
zjj
2024-09-23 539d9ffc477d28a23a923b41fdeabc8c37c99ce6
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
<?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.system.mapper.SaasLogMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.system.entity.SaasLog">
        <result column="id" property="id" />
        <result column="type" property="type" />
        <result column="loc_no" property="locNo" />
        <result column="matnr" property="matnr" />
        <result column="io_time" property="ioTime" />
        <result column="create_by" property="createBy" />
        <result column="create_by_name" property="createByName" />
 
    </resultMap>
    <select id="selectListSummary" resultType="com.zy.system.entity.SaasLog">
        select
            ISNULL(owner,
                   '') owner,
            type,
            matnr ,
            sum(ssl.anfme) anfme
        from
            sys_saas_log ssl
        <where>
            <if test="sDate != null">
                and io_time &gt; #{sDate}
            </if>
            <if test="eDate != null">
                and io_time &lt; #{eDate}
            </if>
            <if test="type != null and type != ''">
                and type = #{type}
            </if>
            <if test="owner != null and owner != ''">
                and owner = #{owner}
            </if>
        </where>
        group by
            ssl.owner,
            ssl.type,
            ssl.matnr
        order by
            ssl.owner,
            type
    </select>
    <select id="selectListSummaryBySubtotal" resultType="com.zy.system.entity.SaasLog">
        select owner,type,sum(anfme) anfme from sys_saas_log
        <where>
            <if test="owner == ''">
                owner IS NULL
            </if>
            <if test="owner != ''">
                owner = #{owner}
            </if>
            <if test="sDate != null">
                and io_time &gt; #{sDate}
            </if>
            <if test="eDate != null">
                and io_time &lt; #{eDate}
            </if>
            <if test="type != null and type != ''">
                and type = #{type}
            </if>
        </where>
        group by owner,type order by owner,type
    </select>
 
</mapper>