skyouc
2025-05-15 f2b48ce0cfdf9b68ecc7c9d84937d69500590f81
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
<?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.vincent.rsf.server.manager.mapper.LocItemMapper">
 
    <select id="pageByStock" resultType="com.vincent.rsf.server.manager.entity.LocItem">
        SELECT *
        FROM (SELECT id,
                     loc_id,
                     loc_code,
                     type,
                     order_item_id,
                     wk_type,
                     matnr_id,
                     maktx,
                     matnr_code,
                     unit,
                     SUM(anfme)    anfme,
                     SUM(qty)      qty,
                     SUM(work_qty) work_qty,
                     batch,
                     spec,
                     model,
                     fields_index,
                     update_by,
                     create_by,
                     update_time,
                     create_time
              FROM man_loc_item
              GROUP BY matnr_id
              UNION ALL
              SELECT id,
                     ''          AS loc_id,
                     ''          AS loc_code,
                     type,
                     asn_item_id AS order_item_id,
                     wk_type,
                     matnr_id,
                     maktx,
                     matnr_code,
                     unit,
                     SUM(anfme)     anfme,
                     SUM(qty)       qty,
                     SUM(work_qty)  work_qty,
                     batch,
                     spec,
                     model,
                     fields_index,
                     update_by,
                     create_by,
                     update_time,
                     create_time
              FROM man_warehouse_areas_item
              GROUP BY matnr_id) t
                ${ew.customSqlSegment}
    </select>
</mapper>