FksbExcelDataMapper.xml
14.5 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<?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.chinagas.modules.fksb.mapper.FksbExcelDataMapper">
<resultMap type="FksbExcelData" id="FksbExcelDataResult">
<result property="id" column="id" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="entity" column="entity" />
<result property="colCv" column="col_cv" />
<result property="colA" column="col_a" />
<result property="colB" column="col_b" />
<result property="colC" column="col_c" />
<result property="colD" column="col_d" />
<result property="colE" column="col_e" />
<result property="colF" column="col_f" />
<result property="colG" column="col_g" />
<result property="colH" column="col_h" />
<result property="colI" column="col_i" />
<result property="colJ" column="col_j" />
<result property="colK" column="col_k" />
<result property="colL" column="col_l" />
<result property="colM" column="col_m" />
<result property="colN" column="col_n" />
<result property="colO" column="col_o" />
<result property="colP" column="col_p" />
<result property="colQ" column="col_q" />
<result property="colR" column="col_r" />
<result property="colS" column="col_s" />
<result property="colT" column="col_t" />
<result property="colU" column="col_u" />
<result property="colV" column="col_v" />
<result property="colW" column="col_w" />
<result property="colX" column="col_x" />
<result property="colY" column="col_y" />
<result property="colZ" column="col_z" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="recordId" column="record_id" />
<result property="rowN" column="row_n" />
</resultMap>
<sql id="selectFksbExcelDataVo">
select id, year, month, entity, col_cv, col_a, col_b, col_c, col_d, col_e, col_f,col_g,col_h,col_i,col_j,col_k,col_l,col_m,col_n,col_o,col_p,col_q,col_r,col_s,col_t,
col_u,col_v,col_w,col_x,col_y,col_z, create_time, create_by, update_time, update_by,record_id,row_n from fksb_excel_data
</sql>
<select id="selectFksbExcelDataList" parameterType="FksbExcelData" resultMap="FksbExcelDataResult">
<include refid="selectFksbExcelDataVo"/>
<where>
<if test="year != null "> and year = #{year}</if>
<if test="month != null "> and month = #{month}</if>
<if test="entity != null and entity != ''"> and entity = #{entity}</if>
<if test="colCv != null "> and col_cv = #{colCv}</if>
<if test="colA != null and colA != ''"> and col_a = #{colA }</if>
<if test="colB != null and colB != ''"> and col_b = #{colB }</if>
<if test="colC != null and colC != ''"> and col_c = #{colC }</if>
<if test="colD != null and colD != ''"> and col_d = #{colD }</if>
<if test="colE != null and colE != ''"> and col_e = #{colE }</if>
<if test="colF != null and colF != ''"> and col_f = #{colF }</if>
<if test="colG != null and colG != ''"> and col_g = #{colG }</if>
<if test="colH != null and colH != ''"> and col_h = #{colH }</if>
<if test="colI != null and colI != ''"> and col_i = #{colI }</if>
<if test="colJ != null and colJ != ''"> and col_j = #{colJ }</if>
<if test="colK != null and colK != ''"> and col_k = #{colK }</if>
<if test="colL != null and colL != ''"> and col_l = #{colL }</if>
<if test="colM != null and colM != ''"> and col_m = #{colM }</if>
<if test="colN != null and colN != ''"> and col_n = #{colN }</if>
<if test="colO != null and colO != ''"> and col_o = #{colO }</if>
<if test="colP != null and colP != ''"> and col_p = #{colP }</if>
<if test="colQ != null and colQ != ''"> and col_q = #{colQ }</if>
<if test="colR != null and colR != ''"> and col_r = #{colR }</if>
<if test="colS != null and colS != ''"> and col_s = #{colS }</if>
<if test="colT != null and colT != ''"> and col_t = #{colT }</if>
<if test="colU != null and colU != ''"> and col_u = #{colU }</if>
<if test="colV != null and colV != ''"> and col_v = #{colV }</if>
<if test="colW != null and colW != ''"> and col_w = #{colW }</if>
<if test="colX != null and colX != ''"> and col_x = #{colX }</if>
<if test="colY != null and colY != ''"> and col_y = #{colY }</if>
<if test="colZ != null and colZ != ''"> and col_z = #{colZ }</if>
<if test="recordId != null and recordId != ''"> and record_id = #{recordId}</if>
</where>
</select>
<select id="selectFksbExcelDataById" parameterType="Long" resultMap="FksbExcelDataResult">
<include refid="selectFksbExcelDataVo"/>
where id = #{id}
</select>
<insert id="insertFksbExcelData" parameterType="FksbExcelData">
insert into fksb_excel_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="year != null">year,</if>
<if test="month != null">month,</if>
<if test="entity != null">entity,</if>
<if test="colCv != null">col_cv,</if>
<if test="colA != null">col_a ,</if>
<if test="colB != null">col_b ,</if>
<if test="colC != null">col_c ,</if>
<if test="colD != null">col_d ,</if>
<if test="colE != null">col_e ,</if>
<if test="colF != null">col_f ,</if>
<if test="colG != null">col_g ,</if>
<if test="colH != null">col_h ,</if>
<if test="colI != null">col_i ,</if>
<if test="colJ != null">col_j ,</if>
<if test="colK != null">col_k ,</if>
<if test="colL != null">col_l ,</if>
<if test="colM != null">col_m ,</if>
<if test="colN != null">col_n ,</if>
<if test="colO != null">col_o ,</if>
<if test="colP != null">col_p ,</if>
<if test="colQ != null">col_q ,</if>
<if test="colR != null">col_r ,</if>
<if test="colS != null">col_s ,</if>
<if test="colT != null">col_t ,</if>
<if test="colU != null">col_u ,</if>
<if test="colV != null">col_v ,</if>
<if test="colW != null">col_w ,</if>
<if test="colX != null">col_x ,</if>
<if test="colY != null">col_y ,</if>
<if test="colZ != null">col_z ,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="recordId != null">record_id,</if>
<if test="rowN != null">row_n,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="entity != null">#{entity},</if>
<if test="colCv != null">#{colCv},</if>
<if test="colA != null">#{col_a },</if>
<if test="colB != null">#{col_b },</if>
<if test="colC != null">#{col_c },</if>
<if test="colD != null">#{col_d },</if>
<if test="colE != null">#{col_e },</if>
<if test="colF != null">#{col_f },</if>
<if test="colG != null">#{col_g },</if>
<if test="colH != null">#{col_h },</if>
<if test="colI != null">#{col_i },</if>
<if test="colJ != null">#{col_j },</if>
<if test="colK != null">#{col_k },</if>
<if test="colL != null">#{col_l },</if>
<if test="colM != null">#{col_m },</if>
<if test="colN != null">#{col_n },</if>
<if test="colO != null">#{col_o },</if>
<if test="colP != null">#{col_p },</if>
<if test="colQ != null">#{col_q },</if>
<if test="colR != null">#{col_r },</if>
<if test="colS != null">#{col_s },</if>
<if test="colT != null">#{col_t },</if>
<if test="colU != null">#{col_u },</if>
<if test="colV != null">#{col_v },</if>
<if test="colW != null">#{col_w },</if>
<if test="colX != null">#{col_x },</if>
<if test="colY != null">#{col_y },</if>
<if test="colZ != null">#{col_z },</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="recordId != null">#{recordId},</if>
<if test="rowN != null">#{rowN},</if>
</trim>
</insert>
<update id="updateFksbExcelData" parameterType="FksbExcelData">
update fksb_excel_data
<trim prefix="SET" suffixOverrides=",">
<if test="year != null">year = #{year},</if>
<if test="month != null">month = #{month},</if>
<if test="entity != null">entity = #{entity},</if>
<if test="colCv != null">col_cv = #{colCv},</if>
<if test="colA != null">col_a = #{colA },</if>
<if test="colB != null">col_b = #{colB },</if>
<if test="colC != null">col_c = #{colC },</if>
<if test="colD != null">col_d = #{colD },</if>
<if test="colE != null">col_e = #{colE },</if>
<if test="colF != null">col_f = #{colF },</if>
<if test="colG != null">col_g = #{colG },</if>
<if test="colH != null">col_h = #{colH },</if>
<if test="colI != null">col_i = #{colI },</if>
<if test="colJ != null">col_j = #{colJ },</if>
<if test="colK != null">col_k = #{colK },</if>
<if test="colL != null">col_l = #{colL },</if>
<if test="colM != null">col_m = #{colM },</if>
<if test="colN != null">col_n = #{colN },</if>
<if test="colO != null">col_o = #{colO },</if>
<if test="colP != null">col_p = #{colP },</if>
<if test="colQ != null">col_q = #{colQ },</if>
<if test="colR != null">col_r = #{colR },</if>
<if test="colS != null">col_s = #{colS },</if>
<if test="colT != null">col_t = #{colT },</if>
<if test="colU != null">col_u = #{colU },</if>
<if test="colV != null">col_v = #{colV },</if>
<if test="colW != null">col_w = #{colW },</if>
<if test="colX != null">col_x = #{colX },</if>
<if test="colY != null">col_y = #{colY },</if>
<if test="colZ != null">col_z = #{colZ },</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
update_time = sysdate()
</trim>
where id = #{id}
</update>
<delete id="deleteFksbExcelDataById" parameterType="Long">
delete from fksb_excel_data where id = #{id}
</delete>
<delete id="deleteFksbExcelDataByIds" parameterType="String">
delete from fksb_excel_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertFksbExcelDatabatch" parameterType="List">
insert into fksb_excel_data(year,month,entity,col_cv,
col_a
, col_b
, col_c
, col_d
, col_e
, col_f
, col_g
, col_h
, col_i
, col_j
, col_k
, col_l
, col_m
, col_n
, col_o
, col_p
, col_q
, col_r
, col_s
, col_t
, col_u
, col_v
, col_w
, col_x
, col_y
, col_z
, record_id,create_time,row_n) values
<foreach collection="list" item="item" separator=",">
(#{item.year},
#{item.month},
#{item.entity},
#{item.colCv},
#{item.colA},
#{item.colB},
#{item.colC},
#{item.colD},
#{item.colE},
#{item.colF},
#{item.colG},
#{item.colH},
#{item.colI},
#{item.colJ},
#{item.colK},
#{item.colL},
#{item.colM},
#{item.colN},
#{item.colO},
#{item.colP},
#{item.colQ},
#{item.colR},
#{item.colS},
#{item.colT},
#{item.colU},
#{item.colV},
#{item.colW},
#{item.colX},
#{item.colY},
#{item.colZ},
#{item.recordId},
sysdate(),#{item.rowN})
</foreach>
</insert>
<delete id="deleteByRecordId" parameterType="Long">
delete from fksb_excel_data where record_id = #{recordId}
</delete>
<select id="getDataByRowNs" resultMap="FksbExcelDataResult" parameterType="java.util.List">
SELECT * from `fksb_excel_data` WHERE row_n in
<foreach collection="list" open="(" separator="," close=")" item="item">
#{item}
</foreach>
GROUP BY col_cv ORDER BY row_n
</select>
<select id="selectDataByRecordId" parameterType="Long" resultMap="FksbExcelDataResult">
<include refid="selectFksbExcelDataVo"/>
where record_id = #{recordId}
</select>
</mapper>