DegradeConfigMapper.xml
7.37 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
<?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.monitor.mysql.mapper.DegradeConfigMapper" >
<resultMap id="BaseResultMap" type="com.monitor.model.domain.DegradeConfig" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="config_name" property="configName" jdbcType="VARCHAR" />
<result column="config_show_name" property="configShowName" jdbcType="VARCHAR" />
<result column="switch_on" property="switchOn" jdbcType="CHAR" />
<result column="config_desc" property="configDesc" jdbcType="VARCHAR" />
<result column="level" property="level" jdbcType="TINYINT" />
<result column="img_url" property="imgUrl" jdbcType="VARCHAR" />
<result column="function_point_name" property="functionPointName" jdbcType="VARCHAR" />
<result column="level1_page" property="level1Page" jdbcType="VARCHAR" />
<result column="level2_page" property="level2Page" jdbcType="VARCHAR" />
<result column="api_name" property="apiName" jdbcType="VARCHAR" />
<result column="client_type" property="clientType" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, config_name, config_show_name, switch_on, config_desc, level, img_url,function_point_name,level1_page,level2_page,api_name,client_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from degrade_info
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.monitor.model.request.DegradeInfoReq">
select
<include refid="Base_Column_List" />
from degrade_info
where 1=1
<if test="switchOn != null && switchOn != '' " >
and switch_on = #{switchOn}
</if>
<if test="level != null && level != '' " >
and level = #{level}
</if>
<if test="level1Page != null && level1Page != '' " >
and level1_page = #{level1Page}
</if>
<if test="level2Page != null && level2Page != '' " >
and level2_page = #{level2Page}
</if>
<if test="clientType != null && clientType != '' &&clientType != '全部' " >
and client_type = #{clientType}
</if>
</select>
<select id="selectInitInfo" resultMap="BaseResultMap">
select DISTINCT function_point_name,level1_page,level2_page
from degrade_info
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from degrade_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.monitor.model.domain.DegradeConfig" >
insert into degrade_info (id, config_name, config_show_name, switch_on,
config_desc, level, img_url,function_point_name,level1_page,level2_page,api_name,client_type
)
values (#{id,jdbcType=INTEGER}, #{configName,jdbcType=VARCHAR}, #{configShowName,jdbcType=VARCHAR}, #{switchOn,jdbcType=CHAR},
#{configDesc,jdbcType=VARCHAR}, #{level,jdbcType=TINYINT}, #{imgUrl,jdbcType=VARCHAR},#{functionPointName,jdbcType=VARCHAR},
#{level1Page,jdbcType=VARCHAR},#{level2Page,jdbcType=VARCHAR},#{apiName,jdbcType=VARCHAR},#{clientType,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.monitor.model.domain.DegradeConfig" >
insert into degrade_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="configName != null" >
config_name,
</if>
<if test="configShowName != null" >
config_show_name,
</if>
<if test="switchOn != null" >
switch_on,
</if>
<if test="configDesc != null" >
config_desc,
</if>
<if test="level != null" >
level,
</if>
<if test="imgUrl != null" >
img_url,
</if>
<if test="functionPointName != null" >
function_point_name,
</if>
<if test="level1Page != null" >
level1_page,
</if>
<if test="level2Page != null" >
level2_page,
</if>
<if test="apiName != null" >
api_name,
</if>
<if test="clientType != null" >
client_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="configName != null" >
#{configName,jdbcType=VARCHAR},
</if>
<if test="configShowName != null" >
#{configShowName,jdbcType=VARCHAR},
</if>
<if test="switchOn != null" >
#{switchOn,jdbcType=CHAR},
</if>
<if test="configDesc != null" >
#{configDesc,jdbcType=VARCHAR},
</if>
<if test="level != null" >
#{level,jdbcType=TINYINT},
</if>
<if test="imgUrl != null" >
#{imgUrl,jdbcType=VARCHAR},
</if>
<if test="functionPointName != null" >
#{functionPointName,jdbcType=VARCHAR},
</if>
<if test="level1Page != null" >
#{level1Page,jdbcType=VARCHAR},
</if>
<if test="level2Page != null" >
#{level2Page,jdbcType=VARCHAR},
</if>
<if test="apiName != null" >
#{apiName,jdbcType=VARCHAR},
</if>
<if test="clientType != null" >
#{clientType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.monitor.model.domain.DegradeConfig" >
update degrade_info
<set >
<if test="configShowName != null" >
config_show_name = #{configShowName,jdbcType=VARCHAR},
</if>
<if test="switchOn != null" >
switch_on = #{switchOn,jdbcType=CHAR},
</if>
<if test="configDesc != null" >
config_desc = #{configDesc,jdbcType=VARCHAR},
</if>
<if test="level != null" >
level = #{level,jdbcType=TINYINT},
</if>
<if test="imgUrl != null" >
img_url = #{imgUrl,jdbcType=VARCHAR},
</if>
<if test="functionPointName != null" >
function_point_name = #{functionPointName,jdbcType=VARCHAR},
</if>
<if test="level1Page != null" >
level1_page = #{level1Page,jdbcType=VARCHAR},
</if>
<if test="level2Page != null" >
level2_page = #{level2Page,jdbcType=VARCHAR},
</if>
<if test="apiName != null" >
api_name = #{apiName,jdbcType=VARCHAR},
</if>
<if test="clientType != null" >
client_type = #{clientType,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.monitor.model.domain.DegradeConfig" >
update degrade_info
set config_name = #{configName,jdbcType=VARCHAR},
config_show_name = #{configShowName,jdbcType=VARCHAR},
switch_on = #{switchOn,jdbcType=CHAR},
config_desc = #{configDesc,jdbcType=VARCHAR},
level = #{level,jdbcType=TINYINT},
img_url = #{imgUrl,jdbcType=VARCHAR},
function_point_name = #{functionPointName,jdbcType=VARCHAR},
level1_page = #{level1Page,jdbcType=VARCHAR},
level2_page = #{level2Page,jdbcType=VARCHAR},
api_name = #{apiName,jdbcType=VARCHAR},
client_type = #{clientType,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>