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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<?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.tanpu.fund.mapper.generator.TxIndustryDistributionMapper">
<resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
<!--@Table tx_industry_distribution-->
<id column="fund_code" jdbcType="INTEGER" property="fundCode" />
<id column="start_date" jdbcType="DATE" property="startDate" />
<id column="end_date" jdbcType="DATE" property="endDate" />
<id column="industry_code" jdbcType="VARCHAR" property="industryCode" />
<result column="industry_name" jdbcType="VARCHAR" property="industryName" />
<result column="market_value" jdbcType="DECIMAL" property="marketValue" />
<result column="proportion" jdbcType="DECIMAL" property="proportion" />
</resultMap>
<sql id="Example_Where_Clause">
<!--@mbg.generated-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--@mbg.generated-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--@mbg.generated-->
fund_code, start_date, end_date, industry_code, industry_name, market_value, proportion
</sql>
<select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistributionExample" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from tx_industry_distribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from tx_industry_distribution
where fund_code = #{fundCode,jdbcType=INTEGER}
and start_date = #{startDate,jdbcType=DATE}
and end_date = #{endDate,jdbcType=DATE}
and industry_code = #{industryCode,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="map">
<!--@mbg.generated-->
delete from tx_industry_distribution
where fund_code = #{fundCode,jdbcType=INTEGER}
and start_date = #{startDate,jdbcType=DATE}
and end_date = #{endDate,jdbcType=DATE}
and industry_code = #{industryCode,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistributionExample">
<!--@mbg.generated-->
delete from tx_industry_distribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
insert into tx_industry_distribution (fund_code, start_date, end_date,
industry_code, industry_name, market_value,
proportion)
values (#{fundCode,jdbcType=INTEGER}, #{startDate,jdbcType=DATE}, #{endDate,jdbcType=DATE},
#{industryCode,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, #{marketValue,jdbcType=DECIMAL},
#{proportion,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
insert into tx_industry_distribution
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fundCode != null">
fund_code,
</if>
<if test="startDate != null">
start_date,
</if>
<if test="endDate != null">
end_date,
</if>
<if test="industryCode != null">
industry_code,
</if>
<if test="industryName != null">
industry_name,
</if>
<if test="marketValue != null">
market_value,
</if>
<if test="proportion != null">
proportion,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fundCode != null">
#{fundCode,jdbcType=INTEGER},
</if>
<if test="startDate != null">
#{startDate,jdbcType=DATE},
</if>
<if test="endDate != null">
#{endDate,jdbcType=DATE},
</if>
<if test="industryCode != null">
#{industryCode,jdbcType=VARCHAR},
</if>
<if test="industryName != null">
#{industryName,jdbcType=VARCHAR},
</if>
<if test="marketValue != null">
#{marketValue,jdbcType=DECIMAL},
</if>
<if test="proportion != null">
#{proportion,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistributionExample" resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from tx_industry_distribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--@mbg.generated-->
update tx_industry_distribution
<set>
<if test="record.fundCode != null">
fund_code = #{record.fundCode,jdbcType=INTEGER},
</if>
<if test="record.startDate != null">
start_date = #{record.startDate,jdbcType=DATE},
</if>
<if test="record.endDate != null">
end_date = #{record.endDate,jdbcType=DATE},
</if>
<if test="record.industryCode != null">
industry_code = #{record.industryCode,jdbcType=VARCHAR},
</if>
<if test="record.industryName != null">
industry_name = #{record.industryName,jdbcType=VARCHAR},
</if>
<if test="record.marketValue != null">
market_value = #{record.marketValue,jdbcType=DECIMAL},
</if>
<if test="record.proportion != null">
proportion = #{record.proportion,jdbcType=DECIMAL},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--@mbg.generated-->
update tx_industry_distribution
set fund_code = #{record.fundCode,jdbcType=INTEGER},
start_date = #{record.startDate,jdbcType=DATE},
end_date = #{record.endDate,jdbcType=DATE},
industry_code = #{record.industryCode,jdbcType=VARCHAR},
industry_name = #{record.industryName,jdbcType=VARCHAR},
market_value = #{record.marketValue,jdbcType=DECIMAL},
proportion = #{record.proportion,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
update tx_industry_distribution
<set>
<if test="industryName != null">
industry_name = #{industryName,jdbcType=VARCHAR},
</if>
<if test="marketValue != null">
market_value = #{marketValue,jdbcType=DECIMAL},
</if>
<if test="proportion != null">
proportion = #{proportion,jdbcType=DECIMAL},
</if>
</set>
where fund_code = #{fundCode,jdbcType=INTEGER}
and start_date = #{startDate,jdbcType=DATE}
and end_date = #{endDate,jdbcType=DATE}
and industry_code = #{industryCode,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
update tx_industry_distribution
set industry_name = #{industryName,jdbcType=VARCHAR},
market_value = #{marketValue,jdbcType=DECIMAL},
proportion = #{proportion,jdbcType=DECIMAL}
where fund_code = #{fundCode,jdbcType=INTEGER}
and start_date = #{startDate,jdbcType=DATE}
and end_date = #{endDate,jdbcType=DATE}
and industry_code = #{industryCode,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update tx_industry_distribution
<trim prefix="set" suffixOverrides=",">
<trim prefix="industry_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when fund_code = #{item.fundCode,jdbcType=INTEGER} then #{item.industryName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="market_value = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when fund_code = #{item.fundCode,jdbcType=INTEGER} then #{item.marketValue,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="proportion = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when fund_code = #{item.fundCode,jdbcType=INTEGER} then #{item.proportion,jdbcType=DECIMAL}
</foreach>
</trim>
</trim>
where fund_code in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.fundCode,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into tx_industry_distribution
(fund_code, start_date, end_date, industry_code, industry_name, market_value, proportion
)
values
<foreach collection="list" item="item" separator=",">
(#{item.fundCode,jdbcType=INTEGER}, #{item.startDate,jdbcType=DATE}, #{item.endDate,jdbcType=DATE},
#{item.industryCode,jdbcType=VARCHAR}, #{item.industryName,jdbcType=VARCHAR}, #{item.marketValue,jdbcType=DECIMAL},
#{item.proportion,jdbcType=DECIMAL})
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
insert into tx_industry_distribution
(fund_code, start_date, end_date, industry_code, industry_name, market_value, proportion
)
values
(#{fundCode,jdbcType=INTEGER}, #{startDate,jdbcType=DATE}, #{endDate,jdbcType=DATE},
#{industryCode,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, #{marketValue,jdbcType=DECIMAL},
#{proportion,jdbcType=DECIMAL})
on duplicate key update
fund_code = #{fundCode,jdbcType=INTEGER},
start_date = #{startDate,jdbcType=DATE},
end_date = #{endDate,jdbcType=DATE},
industry_code = #{industryCode,jdbcType=VARCHAR},
industry_name = #{industryName,jdbcType=VARCHAR},
market_value = #{marketValue,jdbcType=DECIMAL},
proportion = #{proportion,jdbcType=DECIMAL}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.TxIndustryDistribution">
<!--@mbg.generated-->
insert into tx_industry_distribution
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fundCode != null">
fund_code,
</if>
<if test="startDate != null">
start_date,
</if>
<if test="endDate != null">
end_date,
</if>
<if test="industryCode != null">
industry_code,
</if>
<if test="industryName != null">
industry_name,
</if>
<if test="marketValue != null">
market_value,
</if>
<if test="proportion != null">
proportion,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fundCode != null">
#{fundCode,jdbcType=INTEGER},
</if>
<if test="startDate != null">
#{startDate,jdbcType=DATE},
</if>
<if test="endDate != null">
#{endDate,jdbcType=DATE},
</if>
<if test="industryCode != null">
#{industryCode,jdbcType=VARCHAR},
</if>
<if test="industryName != null">
#{industryName,jdbcType=VARCHAR},
</if>
<if test="marketValue != null">
#{marketValue,jdbcType=DECIMAL},
</if>
<if test="proportion != null">
#{proportion,jdbcType=DECIMAL},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="fundCode != null">
fund_code = #{fundCode,jdbcType=INTEGER},
</if>
<if test="startDate != null">
start_date = #{startDate,jdbcType=DATE},
</if>
<if test="endDate != null">
end_date = #{endDate,jdbcType=DATE},
</if>
<if test="industryCode != null">
industry_code = #{industryCode,jdbcType=VARCHAR},
</if>
<if test="industryName != null">
industry_name = #{industryName,jdbcType=VARCHAR},
</if>
<if test="marketValue != null">
market_value = #{marketValue,jdbcType=DECIMAL},
</if>
<if test="proportion != null">
proportion = #{proportion,jdbcType=DECIMAL},
</if>
</trim>
</insert>
</mapper>