|
|
@@ -0,0 +1,185 @@
|
|
|
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.InrecordMapper">
|
|
|
4
|
+
|
|
|
5
|
+ <resultMap id="InrecordResultMap" type="com.shinsoft.sto.model.record.Inrecord">
|
|
|
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="in_ware_name" property="inWareName" jdbcType="VARCHAR"/>
|
|
|
12
|
+ <result column="in_stack_name" property="inStackName" jdbcType="VARCHAR"/>
|
|
|
13
|
+ <result column="in_layer_no" property="inLayerNo" 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="in_weight" property="inWeight" jdbcType="DECIMAL"/>
|
|
|
21
|
+ <result column="in_quantity" property="inQuantity" jdbcType="DECIMAL"/>
|
|
|
22
|
+ <result column="in_flag" property="inFlag" 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="owner_company_name" property="ownerCompanyName" jdbcType="VARCHAR"/>
|
|
|
55
|
+ <result column="receiving_company_name" property="receivingCompanyName" jdbcType="VARCHAR"/>
|
|
|
56
|
+ <result column="customer_company_name" property="customerCompanyName" jdbcType="VARCHAR"/>
|
|
|
57
|
+ <result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
|
|
58
|
+ <result column="material_code" property="materialCode" jdbcType="VARCHAR"/>
|
|
|
59
|
+ <result column="material_standard" property="materialStandard" jdbcType="VARCHAR"/>
|
|
|
60
|
+ <result column="material_model" property="materialModel" jdbcType="VARCHAR"/>
|
|
|
61
|
+ </resultMap>
|
|
|
62
|
+
|
|
|
63
|
+ <sql id="StatisticsWhere">
|
|
|
64
|
+ where 1=1
|
|
|
65
|
+<!-- <if test="parms.belongId != null and parms.belongId != ''">-->
|
|
|
66
|
+<!-- and ir.belong_id = #{parms.belongId}-->
|
|
|
67
|
+<!-- </if>-->
|
|
|
68
|
+ <if test="parms.wareName != null and parms.wareName != ''">
|
|
|
69
|
+ and ir.IN_WARE_NAME like '%' || #{parms.wareName} || '%'
|
|
|
70
|
+ </if>
|
|
|
71
|
+ <if test="parms.stackName != null and parms.stackName != ''">
|
|
|
72
|
+ and ir.IN_STACK_NAME like '%' || #{parms.stackName} || '%'
|
|
|
73
|
+ </if>
|
|
|
74
|
+ <if test="parms.inTruckNo != null and parms.inTruckNo != ''">
|
|
|
75
|
+ and ir.in_truck_no like '%' || #{parms.inTruckNo} || '%'
|
|
|
76
|
+ </if>
|
|
|
77
|
+ <if test="parms.materialName != null and parms.materialName != ''">
|
|
|
78
|
+ and material.material_name like '%' || #{parms.materialName} || '%'
|
|
|
79
|
+ </if>
|
|
|
80
|
+ <if test="parms.ownerCompany != null and parms.ownerCompany != ''">
|
|
|
81
|
+ and owner.id =#{parms.ownerCompany}
|
|
|
82
|
+ </if>
|
|
|
83
|
+ <if test="parms.receivingCompany != null and parms.receivingCompany != ''">
|
|
|
84
|
+ and owner.id =#{parms.receivingCompany}
|
|
|
85
|
+ </if>
|
|
|
86
|
+ <if test="parms.customerCompany != null and parms.customerCompany != ''">
|
|
|
87
|
+ and owner.id =#{parms.customerCompany}
|
|
|
88
|
+ </if>
|
|
|
89
|
+ <if test="parms.startDtm != null and parms.startDtm != ''">
|
|
|
90
|
+ and ir.IN_DTM >= TO_DATE(#{parms.startDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
91
|
+ </if>
|
|
|
92
|
+ <if test="parms.endDtm != null and parms.endDtm != ''">
|
|
|
93
|
+ and ir.IN_DTM <= TO_DATE(#{parms.endDtm}, 'yyyy-MM-dd hh24:mi:ss')
|
|
|
94
|
+ </if>
|
|
|
95
|
+ <if test="parms.prodNo != null and parms.prodNo != ''">
|
|
|
96
|
+ and ir.PROD_NO like '%' || #{parms.prodNo} || '%'
|
|
|
97
|
+ </if>
|
|
|
98
|
+<!-- <if test="parms.orderNo != null and parms.orderNo != ''">-->
|
|
|
99
|
+<!-- and ir.order_NO like '%' || #{parms.orderNo} || '%'-->
|
|
|
100
|
+<!-- </if>-->
|
|
|
101
|
+
|
|
|
102
|
+<!-- <if test="parms.contractNo != null and parms.contractNo != ''">-->
|
|
|
103
|
+<!-- and ir.contract_no like '%' || #{parms.contractNo} || '%'-->
|
|
|
104
|
+<!-- </if>-->
|
|
|
105
|
+ </sql>
|
|
|
106
|
+
|
|
|
107
|
+ <select id="selectInrecordPage" resultMap="InrecordResultMap" parameterType="map">
|
|
|
108
|
+ select
|
|
|
109
|
+ ir.id,
|
|
|
110
|
+ ir.belong_id,
|
|
|
111
|
+ ir.in_truck_no,
|
|
|
112
|
+ ir.tally_people,
|
|
|
113
|
+ ir.in_dtm,
|
|
|
114
|
+ ir.in_ware_name,
|
|
|
115
|
+ ir.in_stack_name,
|
|
|
116
|
+ ir.in_layer_no,
|
|
|
117
|
+ ir.prod_no,
|
|
|
118
|
+ ir.owner_company,
|
|
|
119
|
+ ir.receiving_company,
|
|
|
120
|
+ ir.customer_company,
|
|
|
121
|
+ ir.material_id,
|
|
|
122
|
+ ir.st_grade,
|
|
|
123
|
+ ir.in_weight,
|
|
|
124
|
+ ir.in_quantity,
|
|
|
125
|
+ ir.in_flag,
|
|
|
126
|
+ nvl(ir.delivery_address, owner.default_address) as delivery_address,
|
|
|
127
|
+ ir.attrib_01,
|
|
|
128
|
+ ir.attrib_02,
|
|
|
129
|
+ ir.attrib_03,
|
|
|
130
|
+ ir.attrib_04,
|
|
|
131
|
+ ir.attrib_05,
|
|
|
132
|
+ ir.attrib_06,
|
|
|
133
|
+ ir.attrib_07,
|
|
|
134
|
+ ir.attrib_08,
|
|
|
135
|
+ ir.attrib_09,
|
|
|
136
|
+ ir.attrib_10,
|
|
|
137
|
+ ir.attrib_11,
|
|
|
138
|
+ ir.attrib_12,
|
|
|
139
|
+ ir.attrib_13,
|
|
|
140
|
+ ir.attrib_14,
|
|
|
141
|
+ ir.attrib_15,
|
|
|
142
|
+ ir.attrib_16,
|
|
|
143
|
+ ir.attrib_17,
|
|
|
144
|
+ ir.attrib_18,
|
|
|
145
|
+ ir.attrib_19,
|
|
|
146
|
+ ir.attrib_20,
|
|
|
147
|
+ ir.attrib_21,
|
|
|
148
|
+ ir.attrib_22,
|
|
|
149
|
+ ir.attrib_23,
|
|
|
150
|
+ ir.attrib_24,
|
|
|
151
|
+ ir.attrib_25,
|
|
|
152
|
+ ir.remark_1,
|
|
|
153
|
+ ir.remark_2,
|
|
|
154
|
+ ir.remark_3,
|
|
|
155
|
+ ir.remark_4,
|
|
|
156
|
+ ir.remark_5,
|
|
|
157
|
+ owner.customer_nm as owner_company_name,
|
|
|
158
|
+ receiving.customer_nm as receiving_company_name,
|
|
|
159
|
+ customer.customer_nm as customer_company_name,
|
|
|
160
|
+ material.material_name as material_name,
|
|
|
161
|
+ material.material_code as material_code,
|
|
|
162
|
+ material.material_standard as material_standard,
|
|
|
163
|
+ material.material_model as material_model
|
|
|
164
|
+ from T_IN_RECORD ir
|
|
|
165
|
+ left join T_MAIN_CUSTOMER owner on owner.id = ir.owner_company
|
|
|
166
|
+ left join T_MAIN_CUSTOMER receiving on receiving.id = ir.receiving_company
|
|
|
167
|
+ left join T_MAIN_CUSTOMER customer on customer.id = ir.customer_company
|
|
|
168
|
+ left join T_MAIN_MATERIAL material on material.id = ir.material_id
|
|
|
169
|
+ <include refid="StatisticsWhere"/>
|
|
|
170
|
+ order by ir.in_dtm desc
|
|
|
171
|
+ </select>
|
|
|
172
|
+
|
|
|
173
|
+ <select id="selectStatistics" resultType="map" parameterType="map">
|
|
|
174
|
+ select
|
|
|
175
|
+ nvl(sum(ir.in_quantity), 0) as totalQuantity,
|
|
|
176
|
+ nvl(sum(ir.in_weight), 0) as totalWeight
|
|
|
177
|
+ from T_IN_RECORD ir
|
|
|
178
|
+ left join T_MAIN_CUSTOMER owner on owner.id = ir.owner_company
|
|
|
179
|
+ left join T_MAIN_CUSTOMER receiving on receiving.id = ir.receiving_company
|
|
|
180
|
+ left join T_MAIN_CUSTOMER customer on customer.id = ir.customer_company
|
|
|
181
|
+ left join T_MAIN_MATERIAL material on material.id = ir.material_id
|
|
|
182
|
+ <include refid="StatisticsWhere"/>
|
|
|
183
|
+ </select>
|
|
|
184
|
+</mapper>
|
|
|
185
|
+
|