|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
3
|
+<mapper namespace="com.shinsoft.sto.mapper.record.OutrecordMapper">
|
|
|
4
|
+
|
|
|
5
|
+ <resultMap id="OutrecordResultMap" type="com.shinsoft.sto.model.record.Outrecord">
|
|
|
6
|
+ <id column="id" property="id" jdbcType="VARCHAR"/>
|
|
|
7
|
+ <result column="belong_id" property="belongId" jdbcType="VARCHAR"/>
|
|
|
8
|
+ <result column="in_truck_no" property="inTruckNo" jdbcType="VARCHAR"/>
|
|
|
9
|
+ <result column="tally_people" property="tallyPeople" jdbcType="VARCHAR"/>
|
|
|
10
|
+ <result column="in_dtm" property="inDtm" jdbcType="TIMESTAMP"/>
|
|
|
11
|
+ <result column="out_ware_name" property="outWareName" jdbcType="VARCHAR"/>
|
|
|
12
|
+ <result column="out_stack_name" property="outStackName" jdbcType="VARCHAR"/>
|
|
|
13
|
+ <result column="out_layer_no" property="outLayerNo" jdbcType="VARCHAR"/>
|
|
|
14
|
+ <result column="prod_no" property="prodNo" jdbcType="VARCHAR"/>
|
|
|
15
|
+ <result column="owner_company" property="ownerCompany" jdbcType="VARCHAR"/>
|
|
|
16
|
+ <result column="receiving_company" property="receivingCompany" jdbcType="VARCHAR"/>
|
|
|
17
|
+ <result column="customer_company" property="customerCompany" jdbcType="VARCHAR"/>
|
|
|
18
|
+ <result column="material_id" property="materialId" jdbcType="VARCHAR"/>
|
|
|
19
|
+ <result column="st_grade" property="stGrade" jdbcType="VARCHAR"/>
|
|
|
20
|
+ <result column="out_weight" property="outWeight" jdbcType="DECIMAL"/>
|
|
|
21
|
+ <result column="out_quantity" property="outQuantity" jdbcType="DECIMAL"/>
|
|
|
22
|
+ <result column="out_flag" property="outFlag" jdbcType="VARCHAR"/>
|
|
|
23
|
+ <result column="delivery_address" property="deliveryAddress" jdbcType="VARCHAR"/>
|
|
|
24
|
+ <result column="attrib_01" property="attrib01" jdbcType="VARCHAR"/>
|
|
|
25
|
+ <result column="attrib_02" property="attrib02" jdbcType="VARCHAR"/>
|
|
|
26
|
+ <result column="attrib_03" property="attrib03" jdbcType="VARCHAR"/>
|
|
|
27
|
+ <result column="attrib_04" property="attrib04" jdbcType="VARCHAR"/>
|
|
|
28
|
+ <result column="attrib_05" property="attrib05" jdbcType="VARCHAR"/>
|
|
|
29
|
+ <result column="attrib_06" property="attrib06" jdbcType="VARCHAR"/>
|
|
|
30
|
+ <result column="attrib_07" property="attrib07" jdbcType="VARCHAR"/>
|
|
|
31
|
+ <result column="attrib_08" property="attrib08" jdbcType="VARCHAR"/>
|
|
|
32
|
+ <result column="attrib_09" property="attrib09" jdbcType="VARCHAR"/>
|
|
|
33
|
+ <result column="attrib_10" property="attrib10" jdbcType="VARCHAR"/>
|
|
|
34
|
+ <result column="attrib_11" property="attrib11" jdbcType="VARCHAR"/>
|
|
|
35
|
+ <result column="attrib_12" property="attrib12" jdbcType="VARCHAR"/>
|
|
|
36
|
+ <result column="attrib_13" property="attrib13" jdbcType="VARCHAR"/>
|
|
|
37
|
+ <result column="attrib_14" property="attrib14" jdbcType="VARCHAR"/>
|
|
|
38
|
+ <result column="attrib_15" property="attrib15" jdbcType="VARCHAR"/>
|
|
|
39
|
+ <result column="attrib_16" property="attrib16" jdbcType="VARCHAR"/>
|
|
|
40
|
+ <result column="attrib_17" property="attrib17" jdbcType="VARCHAR"/>
|
|
|
41
|
+ <result column="attrib_18" property="attrib18" jdbcType="VARCHAR"/>
|
|
|
42
|
+ <result column="attrib_19" property="attrib19" jdbcType="VARCHAR"/>
|
|
|
43
|
+ <result column="attrib_20" property="attrib20" jdbcType="VARCHAR"/>
|
|
|
44
|
+ <result column="attrib_21" property="attrib21" jdbcType="VARCHAR"/>
|
|
|
45
|
+ <result column="attrib_22" property="attrib22" jdbcType="VARCHAR"/>
|
|
|
46
|
+ <result column="attrib_23" property="attrib23" jdbcType="VARCHAR"/>
|
|
|
47
|
+ <result column="attrib_24" property="attrib24" jdbcType="VARCHAR"/>
|
|
|
48
|
+ <result column="attrib_25" property="attrib25" jdbcType="VARCHAR"/>
|
|
|
49
|
+ <result column="remark_1" property="remark1" jdbcType="VARCHAR"/>
|
|
|
50
|
+ <result column="remark_2" property="remark2" jdbcType="VARCHAR"/>
|
|
|
51
|
+ <result column="remark_3" property="remark3" jdbcType="VARCHAR"/>
|
|
|
52
|
+ <result column="remark_4" property="remark4" jdbcType="VARCHAR"/>
|
|
|
53
|
+ <result column="remark_5" property="remark5" jdbcType="VARCHAR"/>
|
|
|
54
|
+ <result column="out_truck_no" property="outTruckNo" jdbcType="VARCHAR"/>
|
|
|
55
|
+ <result column="out_dtm" property="outDtm" jdbcType="TIMESTAMP"/>
|
|
|
56
|
+ <result column="distrib_id" property="distribId" jdbcType="VARCHAR"/>
|
|
|
57
|
+ <result column="out_user_id" property="outUserId" jdbcType="VARCHAR"/>
|
|
|
58
|
+ <result column="owner_company_name" property="ownerCompanyName" jdbcType="VARCHAR"/>
|
|
|
59
|
+ <result column="receiving_company_name" property="receivingCompanyName" jdbcType="VARCHAR"/>
|
|
|
60
|
+ <result column="customer_company_name" property="customerCompanyName" jdbcType="VARCHAR"/>
|
|
|
61
|
+ <result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
|
|
62
|
+ <result column="material_code" property="materialCode" jdbcType="VARCHAR"/>
|
|
|
63
|
+ <result column="material_standard" property="materialStandard" jdbcType="VARCHAR"/>
|
|
|
64
|
+ <result column="material_model" property="materialModel" jdbcType="VARCHAR"/>
|
|
|
65
|
+ </resultMap>
|
|
|
66
|
+
|
|
|
67
|
+ <sql id="OutrecordWhere">
|
|
|
68
|
+ where 1=1
|
|
|
69
|
+ <if test="parms.wareName != null and parms.wareName != ''">
|
|
|
70
|
+ and tor.OUT_WARE_NAME like '%' || #{parms.wareName} || '%'
|
|
|
71
|
+ </if>
|
|
|
72
|
+ <if test="parms.outWareName != null and parms.outWareName != ''">
|
|
|
73
|
+ and tor.OUT_WARE_NAME like '%' || #{parms.outWareName} || '%'
|
|
|
74
|
+ </if>
|
|
|
75
|
+ <if test="parms.stackName != null and parms.stackName != ''">
|
|
|
76
|
+ and tor.OUT_STACK_NAME like '%' || #{parms.stackName} || '%'
|
|
|
77
|
+ </if>
|
|
|
78
|
+ <if test="parms.outStackName != null and parms.outStackName != ''">
|
|
|
79
|
+ and tor.OUT_STACK_NAME like '%' || #{parms.outStackName} || '%'
|
|
|
80
|
+ </if>
|
|
|
81
|
+ <if test="parms.outLayerNo != null and parms.outLayerNo != ''">
|
|
|
82
|
+ and tor.OUT_LAYER_NO = #{parms.outLayerNo}
|
|
|
83
|
+ </if>
|
|
|
84
|
+ <if test="parms.inTruckNo != null and parms.inTruckNo != ''">
|
|
|
85
|
+ and tor.IN_TRUCK_NO like '%' || #{parms.inTruckNo} || '%'
|
|
|
86
|
+ </if>
|
|
|
87
|
+ <if test="parms.outTruckNo != null and parms.outTruckNo != ''">
|
|
|
88
|
+ and tor.OUT_TRUCK_NO like '%' || #{parms.outTruckNo} || '%'
|
|
|
89
|
+ </if>
|
|
|
90
|
+ <if test="parms.materialName != null and parms.materialName != ''">
|
|
|
91
|
+ and material.MATERIAL_NAME like '%' || #{parms.materialName} || '%'
|
|
|
92
|
+ </if>
|
|
|
93
|
+ <if test="parms.ownerCompany != null and parms.ownerCompany != ''">
|
|
|
94
|
+ and owner.id = #{parms.ownerCompany}
|
|
|
95
|
+ </if>
|
|
|
96
|
+ <if test="parms.receivingCompany != null and parms.receivingCompany != ''">
|
|
|
97
|
+ and receiving.id = #{parms.receivingCompany}
|
|
|
98
|
+ </if>
|
|
|
99
|
+ <if test="parms.customerCompany != null and parms.customerCompany != ''">
|
|
|
100
|
+ and customer.id = #{parms.customerCompany}
|
|
|
101
|
+ </if>
|
|
|
102
|
+ <if test="parms.startDtm != null and parms.startDtm != ''">
|
|
|
103
|
+ and tor.OUT_DTM >= TO_DATE(#{parms.startDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
104
|
+ </if>
|
|
|
105
|
+ <if test="parms.endDtm != null and parms.endDtm != ''">
|
|
|
106
|
+ and tor.OUT_DTM <= TO_DATE(#{parms.endDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
107
|
+ </if>
|
|
|
108
|
+ <if test="parms.startOutDtm != null and parms.startOutDtm != ''">
|
|
|
109
|
+ and tor.OUT_DTM >= TO_DATE(#{parms.startOutDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
110
|
+ </if>
|
|
|
111
|
+ <if test="parms.endOutDtm != null and parms.endOutDtm != ''">
|
|
|
112
|
+ and tor.OUT_DTM <= TO_DATE(#{parms.endOutDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
113
|
+ </if>
|
|
|
114
|
+ <if test="parms.startInDtm != null and parms.startInDtm != ''">
|
|
|
115
|
+ and tor.IN_DTM >= TO_DATE(#{parms.startInDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
116
|
+ </if>
|
|
|
117
|
+ <if test="parms.endInDtm != null and parms.endInDtm != ''">
|
|
|
118
|
+ and tor.IN_DTM <= TO_DATE(#{parms.endInDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
119
|
+ </if>
|
|
|
120
|
+ <if test="parms.prodNo != null and parms.prodNo != ''">
|
|
|
121
|
+ and tor.PROD_NO like '%' || #{parms.prodNo} || '%'
|
|
|
122
|
+ </if>
|
|
|
123
|
+ <if test="parms.materialId != null and parms.materialId != ''">
|
|
|
124
|
+ and tor.MATERIAL_ID = #{parms.materialId}
|
|
|
125
|
+ </if>
|
|
|
126
|
+ <if test="parms.outFlag != null and parms.outFlag != ''">
|
|
|
127
|
+ and tor.OUT_FLAG = #{parms.outFlag}
|
|
|
128
|
+ </if>
|
|
|
129
|
+ <if test="parms.distribId != null and parms.distribId != ''">
|
|
|
130
|
+ and tor.DISTRIB_ID = #{parms.distribId}
|
|
|
131
|
+ </if>
|
|
|
132
|
+ <if test="parms.outUserId != null and parms.outUserId != ''">
|
|
|
133
|
+ and tor.OUT_USER_ID = #{parms.outUserId}
|
|
|
134
|
+ </if>
|
|
|
135
|
+ </sql>
|
|
|
136
|
+
|
|
|
137
|
+ <select id="selectOutrecordPage" resultMap="OutrecordResultMap" parameterType="map">
|
|
|
138
|
+ select
|
|
|
139
|
+ tor.id,
|
|
|
140
|
+ tor.belong_id,
|
|
|
141
|
+ tor.in_truck_no,
|
|
|
142
|
+ tor.tally_people,
|
|
|
143
|
+ tor.in_dtm,
|
|
|
144
|
+ tor.out_ware_name,
|
|
|
145
|
+ tor.out_stack_name,
|
|
|
146
|
+ tor.out_layer_no,
|
|
|
147
|
+ tor.prod_no,
|
|
|
148
|
+ tor.owner_company,
|
|
|
149
|
+ tor.receiving_company,
|
|
|
150
|
+ tor.customer_company,
|
|
|
151
|
+ tor.material_id,
|
|
|
152
|
+ tor.st_grade,
|
|
|
153
|
+ tor.out_weight,
|
|
|
154
|
+ tor.out_quantity,
|
|
|
155
|
+ tor.out_flag,
|
|
|
156
|
+ nvl(tor.delivery_address, owner.default_address) as delivery_address,
|
|
|
157
|
+ tor.attrib_01,
|
|
|
158
|
+ tor.attrib_02,
|
|
|
159
|
+ tor.attrib_03,
|
|
|
160
|
+ tor.attrib_04,
|
|
|
161
|
+ tor.attrib_05,
|
|
|
162
|
+ tor.attrib_06,
|
|
|
163
|
+ tor.attrib_07,
|
|
|
164
|
+ tor.attrib_08,
|
|
|
165
|
+ tor.attrib_09,
|
|
|
166
|
+ tor.attrib_10,
|
|
|
167
|
+ tor.attrib_11,
|
|
|
168
|
+ tor.attrib_12,
|
|
|
169
|
+ tor.attrib_13,
|
|
|
170
|
+ tor.attrib_14,
|
|
|
171
|
+ tor.attrib_15,
|
|
|
172
|
+ tor.attrib_16,
|
|
|
173
|
+ tor.attrib_17,
|
|
|
174
|
+ tor.attrib_18,
|
|
|
175
|
+ tor.attrib_19,
|
|
|
176
|
+ tor.attrib_20,
|
|
|
177
|
+ tor.attrib_21,
|
|
|
178
|
+ tor.attrib_22,
|
|
|
179
|
+ tor.attrib_23,
|
|
|
180
|
+ tor.attrib_24,
|
|
|
181
|
+ tor.attrib_25,
|
|
|
182
|
+ tor.remark_1,
|
|
|
183
|
+ tor.remark_2,
|
|
|
184
|
+ tor.remark_3,
|
|
|
185
|
+ tor.remark_4,
|
|
|
186
|
+ tor.remark_5,
|
|
|
187
|
+ tor.out_truck_no,
|
|
|
188
|
+ tor.out_dtm,
|
|
|
189
|
+ tor.distrib_id,
|
|
|
190
|
+ tor.out_user_id,
|
|
|
191
|
+ owner.customer_nm as owner_company_name,
|
|
|
192
|
+ receiving.customer_nm as receiving_company_name,
|
|
|
193
|
+ customer.customer_nm as customer_company_name,
|
|
|
194
|
+ material.material_name as material_name,
|
|
|
195
|
+ material.material_code as material_code,
|
|
|
196
|
+ material.material_standard as material_standard,
|
|
|
197
|
+ material.material_model as material_model
|
|
|
198
|
+ from T_OUT_RECORD tor
|
|
|
199
|
+ left join T_MAIN_CUSTOMER owner on owner.id = tor.owner_company
|
|
|
200
|
+ left join T_MAIN_CUSTOMER receiving on receiving.id = tor.receiving_company
|
|
|
201
|
+ left join T_MAIN_CUSTOMER customer on customer.id = tor.customer_company
|
|
|
202
|
+ left join T_MAIN_MATERIAL material on material.id = tor.material_id
|
|
|
203
|
+ <include refid="OutrecordWhere"/>
|
|
|
204
|
+ order by tor.out_dtm desc
|
|
|
205
|
+ </select>
|
|
|
206
|
+
|
|
|
207
|
+ <select id="selectStatistics" resultType="map" parameterType="map">
|
|
|
208
|
+ select
|
|
|
209
|
+ nvl(sum(tor.out_quantity), 0) as totalQuantity,
|
|
|
210
|
+ nvl(sum(tor.out_weight), 0) as totalWeight
|
|
|
211
|
+ from T_OUT_RECORD tor
|
|
|
212
|
+ left join T_MAIN_CUSTOMER owner on owner.id = tor.owner_company
|
|
|
213
|
+ left join T_MAIN_CUSTOMER receiving on receiving.id = tor.receiving_company
|
|
|
214
|
+ left join T_MAIN_CUSTOMER customer on customer.id = tor.customer_company
|
|
|
215
|
+ left join T_MAIN_MATERIAL material on material.id = tor.material_id
|
|
|
216
|
+ <include refid="OutrecordWhere"/>
|
|
|
217
|
+ </select>
|
|
|
218
|
+</mapper>
|
|
|
219
|
+
|