|
@@ -0,0 +1,167 @@
|
|
|
|
+<?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.jjt.biz.mapper.AlarmRecordMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="AlarmRecord" id="AlarmRecordResult">
|
|
|
|
+ <result property="alarmId" column="ALARM_ID"/>
|
|
|
|
+ <result property="objId" column="OBJ_ID"/>
|
|
|
|
+ <result property="objMetricsId" column="OBJ_METRICS_ID"/>
|
|
|
|
+ <result property="alarmType" column="ALARM_TYPE"/>
|
|
|
|
+ <result property="alarmLevel" column="ALARM_LEVEL"/>
|
|
|
|
+ <result property="alarmValue" column="ALARM_VALUE"/>
|
|
|
|
+ <result property="alarmTime" column="ALARM_TIME"/>
|
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectAlarmRecordVo">
|
|
|
|
+ select ALARM_ID, OBJ_ID, OBJ_METRICS_ID, ALARM_TYPE, ALARM_LEVEL, ALARM_VALUE, ALARM_TIME, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
|
+ from alarm_record
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectAlarmRecordList" parameterType="AlarmRecord" resultMap="AlarmRecordResult">
|
|
|
|
+ <include refid="selectAlarmRecordVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="objId != null ">
|
|
|
|
+ and OBJ_ID = #{objId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="objMetricsId != null ">
|
|
|
|
+ and OBJ_METRICS_ID = #{objMetricsId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
|
+ and ALARM_TYPE = #{alarmType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmLevel != null and alarmLevel != ''">
|
|
|
|
+ and ALARM_LEVEL = #{alarmLevel}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmValue != null and alarmValue != ''">
|
|
|
|
+ and ALARM_VALUE = #{alarmValue}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="params.beginAlarmTime != null and params.beginAlarmTime != '' and params.endAlarmTime != null and params.endAlarmTime != ''">
|
|
|
|
+ and ALARM_TIME between #{params.beginAlarmTime} and #{params.endAlarmTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
|
|
|
+ and CREATE_TIME between #{params.beginCreateTime} and #{params.endCreateTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
|
|
|
|
+ and UPDATE_TIME between #{params.beginUpdateTime} and #{params.endUpdateTime}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAlarmRecordByAlarmId" parameterType="Long"
|
|
|
|
+ resultMap="AlarmRecordResult">
|
|
|
|
+ <include refid="selectAlarmRecordVo"/>
|
|
|
|
+ where ALARM_ID = #{alarmId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertAlarmRecord" parameterType="AlarmRecord" useGeneratedKeys="true"
|
|
|
|
+ keyProperty="alarmId">
|
|
|
|
+ insert into alarm_record
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="objId != null">OBJ_ID,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="objMetricsId != null">OBJ_METRICS_ID,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmType != null">ALARM_TYPE,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmLevel != null">ALARM_LEVEL,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmValue != null">ALARM_VALUE,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmTime != null">ALARM_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">CREATE_BY,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">CREATE_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">UPDATE_BY,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">UPDATE_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">REMARK,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="objId != null">#{objId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="objMetricsId != null">#{objMetricsId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmType != null">#{alarmType},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmLevel != null">#{alarmLevel},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmValue != null">#{alarmValue},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmTime != null">#{alarmTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">#{remark},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateAlarmRecord" parameterType="AlarmRecord">
|
|
|
|
+ update alarm_record
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="objId != null">OBJ_ID =
|
|
|
|
+ #{objId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="objMetricsId != null">OBJ_METRICS_ID =
|
|
|
|
+ #{objMetricsId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmType != null">ALARM_TYPE =
|
|
|
|
+ #{alarmType},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmLevel != null">ALARM_LEVEL =
|
|
|
|
+ #{alarmLevel},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmValue != null">ALARM_VALUE =
|
|
|
|
+ #{alarmValue},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="alarmTime != null">ALARM_TIME =
|
|
|
|
+ #{alarmTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy != null">CREATE_BY =
|
|
|
|
+ #{createBy},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">CREATE_TIME =
|
|
|
|
+ #{createTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy != null">UPDATE_BY =
|
|
|
|
+ #{updateBy},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">UPDATE_TIME =
|
|
|
|
+ #{updateTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="remark != null">REMARK =
|
|
|
|
+ #{remark},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ where ALARM_ID = #{alarmId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteAlarmRecordByAlarmId" parameterType="Long">
|
|
|
|
+ delete
|
|
|
|
+ from alarm_record where ALARM_ID = #{alarmId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteAlarmRecordByAlarmIds" parameterType="String">
|
|
|
|
+ delete from alarm_record where ALARM_ID in
|
|
|
|
+ <foreach item="alarmId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{alarmId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|