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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
| <?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.AsnOrderItemMapper">
|
| <select id="resultForMap" resultType="java.util.Map">
| SELECT
| *
| FROM
| (
| SELECT
| aoi.id,
| aoi.order_id,
| aoi.order_code,
| aoi.plat_item_id,
| aoi.po_detl_id,
| aoi.plat_order_code,
| aoi.project_code,
| aoi.ispt_status,
| aoi.ispt_result,
| aoi.batch,
| aoi.spec,
| aoi.model,
| aoi.plat_work_code,
| aoi.po_code,
| aoi.fields_index,
| aoi.matnr_id,
| aoi.matnr_code,
| aoi.maktx,
| aoi.anfme,
| aoi.stock_unit,
| aoi.pur_qty,
| aoi.work_qty,
| aoi.pur_unit,
| aoi.prod_time,
| aoi.qty,
| -- qii.safe_qty,
| -- qii.dis_qty,
| aoi.splr_code,
| aoi.splr_batch,
| aoi.splr_name,
| aoi.qrcode,
| aoi.track_code,
| aoi.barcode,
| aoi.pack_name,
| aoi.nty_status,
| aoi.`status`,
| CASE
| aoi.ispt_result
| WHEN 0 THEN
| '未检'
| WHEN 1 THEN
| '合格'
| WHEN 2 THEN
| '不合格'
| WHEN 3 THEN
| '待定'
| WHEN 4 THEN
| '部分合格'
| END AS isptResult$,
| aoi.deleted,
| aoi.tenant_id,
| aoi.create_by,
| aoi.create_time,
| aoi.update_by,
| aoi.update_time,
| aoi.memo
| FROM
| man_asn_order_item aoi
| where aoi.deleted = 0
| -- LEFT JOIN man_qly_ispt_item qii ON aoi.id = qii.asn_item_id
| ) t
| ${ew.customSqlSegment}
| </select>
| <select id="resultById" resultType="com.vincent.rsf.server.manager.entity.WkOrderItem">
| SELECT
| *
| FROM
| (
| SELECT
| aoi.id,
| aoi.order_id,
| aoi.order_code,
| aoi.plat_item_id,
| aoi.plat_work_code,
| aoi.po_detl_id,
| aoi.po_code,
| aoi.fields_index,
| aoi.matnr_id,
| aoi.matnr_code,
| aoi.maktx,
| aoi.anfme,
| aoi.stock_unit,
| aoi.work_qty,
| aoi.pur_qty,
| aoi.pur_unit,
| aoi.prod_time,
| aoi.qty,
| qii.safe_qty,
| qii.dis_qty,
| aoi.splr_code,
| aoi.splr_batch,
| aoi.splr_name,
| aoi.qrcode,
| aoi.track_code,
| aoi.barcode,
| aoi.pack_name,
| aoi.nty_status,
| aoi.`status`,
| aoi.`ispt_result`,
| CASE
| aoi.ispt_result
| WHEN 0 THEN
| '未检'
| WHEN 1 THEN
| '合格'
| WHEN 2 THEN
| '不合格'
| WHEN 3 THEN
| '待定'
| WHEN 4 THEN
| '部分合格'
| END AS isptResult$,
| aoi.deleted,
| aoi.tenant_id,
| aoi.create_by,
| aoi.create_time,
| aoi.update_by,
| aoi.update_time,
| aoi.memo
| FROM
| man_asn_order_item aoi
| where aoi.deleted = 0
| -- LEFT JOIN man_qly_ispt_item qii ON aoi.id = qii.asn_item_id
| ) t
| ${ew.customSqlSegment}
| </select>
|
| <select id="queryFullOrder" resultType="com.vincent.rsf.server.manager.entity.InOrderAndItem">
| SELECT mo.po_code, mo.type, sys_dict_data.label as wkType$, purchase_org_name, purchase_user_name, business_time,
| supplier_id, supplier_name, plat_work_code, plat_item_id, matnr_code, maktx, batch, stock_unit,
| mi.anfme, mi.qty, target_warehouse_id, username, mi.create_time
| FROM man_asn_order_item mi
| LEFT JOIN man_asn_order mo ON mi.order_id = mo.id AND mo.tenant_id = mi.tenant_id
| LEFT JOIN sys_dict_data ON sys_dict_data.dict_type_id = 27 and mo.wk_type = sys_dict_data.`value`
| LEFT JOIN sys_user ON mi.create_by = sys_user.id AND sys_user.tenant_id = mi.tenant_id
| WHERE mo.type = 'in'
| </select>
|
| <select id="queryFullOrderWithPaging" resultType="com.vincent.rsf.server.manager.entity.InOrderAndItem">
| SELECT mi.id, mo.po_code, mo.type, sd.label as wkType$, purchase_org_name, purchase_user_name, business_time,
| supplier_id, supplier_name, plat_work_code, plat_item_id, matnr_code, maktx, batch, stock_unit,
| mi.anfme, mi.qty, target_warehouse_id, username, mi.create_time
| FROM man_asn_order_item mi
| LEFT JOIN man_asn_order mo ON mi.order_id = mo.id AND mo.tenant_id = mi.tenant_id
| LEFT JOIN sys_dict_data sd ON sd.dict_type_id = 27 and mo.wk_type = sd.`value` AND sd.tenant_id = mo.tenant_id
| LEFT JOIN sys_user su ON mi.create_by = su.id AND su.tenant_id = mo.tenant_id
| ${ew.customSqlSegment}
| </select>
| </mapper>
|
|