MalIpRuleMapper.xml
1.39 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
<?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.MalIpRuleMapper" >
<resultMap id="BaseResultMap" type="com.model.MalIpRule" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="rule" property="rule" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, name,rule
</sql>
<select id="selectCount" resultType="java.lang.Integer">
select count(1) from mal_ip_rule
</select>
<select id="selectMalIpRulesByPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from mal_ip_rule
order by id desc
limit #{startIndex},#{pageSize}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from mal_ip_rule
order by id desc
</select>
<insert id="insert" parameterType="com.model.MalIpRule">
insert into mal_ip_rule(name,rule)
values(#{name,jdbcType=VARCHAR},#{rule,jdbcType=VARCHAR})
</insert>
<delete id="deleteById" parameterType="java.lang.Integer">
delete from mal_ip_rule where id = #{id,jdbcType=INTEGER}
</delete>
</mapper>