MalIpRuleMapper.xml 1.39 KB
<?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>