AppDegradeConfigMapper.xml
2.73 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
<?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.AppDegradeConfigMapper">
<resultMap id="BaseResultMap" type="com.monitor.model.domain.AppDegradeConfig">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="switch_on" property="switchOn" jdbcType="CHAR"/>
<result column="api_name" property="apiName" jdbcType="VARCHAR"/>
<result column="api_code" property="apiCode" jdbcType="VARCHAR"/>
<result column="api_desc" property="apiDesc" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,api_name,api_code,api_desc,switch_on
</sql>
<select id="selectByCondition" resultMap="BaseResultMap"
parameterType="com.monitor.model.request.AppDegradeInfoReq">
select
<include refid="Base_Column_List"/>
from app_degrade_config
where 1=1
<if test="switchOn != null && switchOn != '' ">
and switch_on = #{switchOn}
</if>
<if test="apiCode != null && apiCode != '' ">
and api_code = #{apiCode}
</if>
<if test="apiName != null && apiName != '' ">
and api_name = #{apiName}
</if>
<if test="apiDesc != null && apiDesc != '' ">
and api_desc like CONCAT('%', #{apiDesc},'%')
</if>
limit #{start},#{pageSize}
</select>
<select id="selectCountByCondition" resultType="java.lang.Integer"
parameterType="com.monitor.model.request.AppDegradeInfoReq">
select
count(1)
from app_degrade_config
where 1=1
<if test="switchOn != null && switchOn != '' ">
and switch_on = #{switchOn}
</if>
<if test="apiName != null && apiName != '' ">
and api_name = #{apiName}
</if>
<if test="apiCode != null && apiCode != '' ">
and api_code = #{apiCode}
</if>
<if test="apiDesc != null && apiDesc != '' ">
and api_desc like CONCAT('%', #{apiDesc},'%')
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.monitor.model.domain.AppDegradeConfig">
update app_degrade_config
<set>
<if test="switchOn != null">
switch_on = #{switchOn,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getAllDegradeApi" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from app_degrade_config
where switch_on='Y';
</select>
</mapper>