HystrixInfoConfigMapper.xml
3.07 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
<?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.HystrixInfoConfigMapper" >
<resultMap id="BaseResultMap" type="com.monitor.model.domain.HystrixInfoConfig" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="config_name" property="configName" jdbcType="VARCHAR" />
<result column="config_value" property="configValue" jdbcType="VARCHAR" />
<result column="config_desc" property="configDesc" jdbcType="VARCHAR" />
<result column="config_cat" property="configCat" jdbcType="VARCHAR" />
<result column="server_type" property="serverType" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, config_name, config_value, config_desc, config_cat, server_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from hystrix_info
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectDistinctCategories" resultType="java.lang.String" >
select
distinct config_cat
from hystrix_info
</select>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.monitor.model.request.HystrixInfoReq">
select
<include refid="Base_Column_List" />
from hystrix_info
where 1=1
<if test="id != null and id !=0" >
and id = #{id}
</if>
<if test="configName != null and configName != '' " >
and config_name = #{configName}
</if>
<if test="configCat != null and configCat != 0 " >
and config_cat = #{configCat}
</if>
<if test="serverType != null and serverType != 'all' " >
and server_type = #{serverType}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from hystrix_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.monitor.model.domain.DegradeConfig" >
insert into hystrix_info (id, config_name, config_value, config_desc, config_cat, server_type)
values (#{id,jdbcType=INTEGER}, #{configName,jdbcType=VARCHAR}, #{configValue,jdbcType=VARCHAR},#{configDesc,jdbcType=VARCHAR},
#{configCat,jdbcType=INTEGER},#{serverType,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKey" parameterType="com.monitor.model.domain.HystrixInfoConfig" >
update hystrix_info
<set >
<if test="configName != null" >
config_name = #{configName,jdbcType=VARCHAR},
</if>
<if test="configValue != null" >
config_value = #{configValue,jdbcType=VARCHAR},
</if>
<if test="configDesc != null" >
config_desc = #{configDesc,jdbcType=VARCHAR},
</if>
<if test="configCat != null" >
config_cat = #{configCat,jdbcType=INTEGER},
</if>
<if test="serverType != null" >
server_type = #{serverType,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>