RabbitAlertMapper.xml
1.38 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.RabbitAlertMapper">
<cache></cache>
<resultMap id="rabbitAlertInfoMapper" type="com.model.RabbitAlertInfo">
<id property="moId" column="id"></id>
<id property="queueName" column="alias"></id>
<id property="alertHigh" column="alert"></id>
</resultMap>
<select id="getAllAlertsInfo" resultType="com.model.RabbitAlertInfo" resultMap="rabbitAlertInfoMapper">
SELECT * FROM rabbitalert_info ORDER BY id asc
</select>
<select id="queryAlertInfo" resultType="com.model.RabbitAlertInfo" resultMap="rabbitAlertInfoMapper">
SELECT * FROM rabbitalert_info WHERE id = #{moId} AND alias= #{queueName}
</select>
<insert id="insertAlertInfo" parameterType="com.model.RabbitAlertInfo">
INSERT INTO rabbitalert_info(id,alias,alert) VALUES (#{moId},#{queueName},#{alertHigh})
</insert>
<delete id="deleteAlertInfo" parameterType="com.model.RabbitAlertInfo">
DELETE FROM rabbitalert_info WHERE id = #{moId} AND alias= #{queueName}
</delete>
<update id="updateAlertInfo" parameterType="com.model.RabbitAlertInfo">
UPDATE rabbitalert_info SET alert=#{alertHigh} WHERE id = #{moId} AND alias= #{queueName}
</update>
</mapper>