SearchAdminMapper.xml
6.17 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
<?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.yoho.search.dal.SearchAdminMapper">
<!-- <cache eviction="LRU" type="com.yoho.search.redis.MybatisRedisCache"
/> -->
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SearchAdmin">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="scene_code" property="sceneCode" jdbcType="VARCHAR" />
<result column="field_name1" property="fieldName1" jdbcType="VARCHAR" />
<result column="weight1" property="weight1" jdbcType="BIGINT" />
<result column="field_name2" property="fieldName2" jdbcType="VARCHAR" />
<result column="weight2" property="weight2" jdbcType="BIGINT" />
<result column="field_name3" property="fieldName3" jdbcType="VARCHAR" />
<result column="weight3" property="weight3" jdbcType="BIGINT" />
<result column="field_name4" property="fieldName4" jdbcType="VARCHAR" />
<result column="weight4" property="weight4" jdbcType="BIGINT" />
<result column="field_name5" property="fieldName5" jdbcType="VARCHAR" />
<result column="weight5" property="weight5" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List">
id, scene_code, field_name1, weight1, field_name2, weight2, field_name3,
weight3,
field_name4, weight4, field_name5, weight5
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Long" timeout="20000">
select
<include refid="Base_Column_List" />
from search_admin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" timeout="20000">
delete from search_admin
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
insert ignore into search_admin (id, scene_code, field_name1,
weight1, field_name2, weight2,
field_name3, weight3, field_name4,
weight4, field_name5, weight5
)
values (#{id,jdbcType=BIGINT}, #{sceneCode,jdbcType=VARCHAR},
#{fieldName1,jdbcType=VARCHAR},
#{weight1,jdbcType=BIGINT}, #{fieldName2,jdbcType=VARCHAR}, #{weight2,jdbcType=BIGINT},
#{fieldName3,jdbcType=VARCHAR}, #{weight3,jdbcType=BIGINT},
#{fieldName4,jdbcType=VARCHAR},
#{weight4,jdbcType=BIGINT}, #{fieldName5,jdbcType=VARCHAR}, #{weight5,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
insert ignore into search_admin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="sceneCode != null">
scene_code,
</if>
<if test="fieldName1 != null">
field_name1,
</if>
<if test="weight1 != null">
weight1,
</if>
<if test="fieldName2 != null">
field_name2,
</if>
<if test="weight2 != null">
weight2,
</if>
<if test="fieldName3 != null">
field_name3,
</if>
<if test="weight3 != null">
weight3,
</if>
<if test="fieldName4 != null">
field_name4,
</if>
<if test="weight4 != null">
weight4,
</if>
<if test="fieldName5 != null">
field_name5,
</if>
<if test="weight5 != null">
weight5,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="sceneCode != null">
#{sceneCode,jdbcType=VARCHAR},
</if>
<if test="fieldName1 != null">
#{fieldName1,jdbcType=VARCHAR},
</if>
<if test="weight1 != null">
#{weight1,jdbcType=BIGINT},
</if>
<if test="fieldName2 != null">
#{fieldName2,jdbcType=VARCHAR},
</if>
<if test="weight2 != null">
#{weight2,jdbcType=BIGINT},
</if>
<if test="fieldName3 != null">
#{fieldName3,jdbcType=VARCHAR},
</if>
<if test="weight3 != null">
#{weight3,jdbcType=BIGINT},
</if>
<if test="fieldName4 != null">
#{fieldName4,jdbcType=VARCHAR},
</if>
<if test="weight4 != null">
#{weight4,jdbcType=BIGINT},
</if>
<if test="fieldName5 != null">
#{fieldName5,jdbcType=VARCHAR},
</if>
<if test="weight5 != null">
#{weight5,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
update search_admin
<set>
<if test="sceneCode != null">
scene_code = #{sceneCode,jdbcType=VARCHAR},
</if>
<if test="fieldName1 != null">
field_name1 = #{fieldName1,jdbcType=VARCHAR},
</if>
<if test="weight1 != null">
weight1 = #{weight1,jdbcType=BIGINT},
</if>
<if test="fieldName2 != null">
field_name2 = #{fieldName2,jdbcType=VARCHAR},
</if>
<if test="weight2 != null">
weight2 = #{weight2,jdbcType=BIGINT},
</if>
<if test="fieldName3 != null">
field_name3 = #{fieldName3,jdbcType=VARCHAR},
</if>
<if test="weight3 != null">
weight3 = #{weight3,jdbcType=BIGINT},
</if>
<if test="fieldName4 != null">
field_name4 = #{fieldName4,jdbcType=VARCHAR},
</if>
<if test="weight4 != null">
weight4 = #{weight4,jdbcType=BIGINT},
</if>
<if test="fieldName5 != null">
field_name5 = #{fieldName5,jdbcType=VARCHAR},
</if>
<if test="weight5 != null">
weight5 = #{weight5,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
update search_admin
set scene_code = #{sceneCode,jdbcType=VARCHAR},
field_name1 = #{fieldName1,jdbcType=VARCHAR},
weight1 = #{weight1,jdbcType=BIGINT},
field_name2 = #{fieldName2,jdbcType=VARCHAR},
weight2 = #{weight2,jdbcType=BIGINT},
field_name3 = #{fieldName3,jdbcType=VARCHAR},
weight3 = #{weight3,jdbcType=BIGINT},
field_name4 = #{fieldName4,jdbcType=VARCHAR},
weight4 = #{weight4,jdbcType=BIGINT},
field_name5 = #{fieldName5,jdbcType=VARCHAR},
weight5 = #{weight5,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectBySceneCode" parameterType="java.lang.String"
resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from search_admin
where scene_code = #{sceneCode,jdbcType=VARCHAR}
</select>
</mapper>