|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<resultMap type="RecordAlarm" id="RecordAlarmResult">
|
|
|
|
|
<result property="sensorId" column="Sensor_Id" />
|
|
|
|
|
<result property="alarmtypeId" column="AlarmType_Id" />
|
|
|
|
|
<result property="alarmuid" column="Alarm_Uid" />
|
|
|
|
|
<result property="minValue" column="Min_Value" />
|
|
|
|
|
<result property="alarmValue" column="Alarm_Value" />
|
|
|
|
|
<result property="maxValue" column="Max_Value" />
|
|
|
|
@ -19,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<resultMap type="RecordAlarmDto" id="RecordAlarmDtoResult">
|
|
|
|
|
<result property="sensorId" column="Sensor_Id" />
|
|
|
|
|
<result property="alarmtypeId" column="AlarmType_Id" />
|
|
|
|
|
<result property="alarmuid" column="Alarm_Uid" />
|
|
|
|
|
<result property="minValue" column="Min_Value" />
|
|
|
|
|
<result property="alarmValue" column="Alarm_Value" />
|
|
|
|
|
<result property="maxValue" column="Max_Value" />
|
|
|
|
@ -35,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRecordAlarmVo">
|
|
|
|
|
select Sensor_Id, AlarmType_Id, Min_Value, Alarm_Value, Max_Value,Dispose_Flag, Collect_Time,Dispose_Mode,Alarm_Reason from record_alarm
|
|
|
|
|
select Sensor_Id, AlarmType_Id, Min_Value, Alarm_Value,Alarm_Uid, Max_Value,Dispose_Flag, Collect_Time,Dispose_Mode,Alarm_Reason from record_alarm
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordAlarmList" parameterType="RecordAlarm" resultMap="RecordAlarmResult">
|
|
|
|
@ -52,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordAlarmBySensorId" parameterType="String" resultMap="RecordAlarmResult">
|
|
|
|
|
<include refid="selectRecordAlarmVo"/>
|
|
|
|
|
where Sensor_Id = #{sensorId}
|
|
|
|
|
where Alarm_Uid = #{alarmuid}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertRecordAlarm" parameterType="RecordAlarm">
|
|
|
|
@ -82,25 +84,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<update id="updateRecordAlarm" parameterType="RecordAlarm">
|
|
|
|
|
update record_alarm
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="alarmtypeId != null">AlarmType_Id = #{alarmtypeId},</if>
|
|
|
|
|
<!--<if test="alarmtypeId != null">AlarmType_Id = #{alarmtypeId},</if>
|
|
|
|
|
<if test="minValue != null">Min_Value = #{minValue},</if>
|
|
|
|
|
<if test="alarmValue != null">Alarm_Value = #{alarmValue},</if>
|
|
|
|
|
<if test="maxValue != null">Max_Value = #{maxValue},</if>
|
|
|
|
|
<if test="collectTime != null">Collect_Time = #{collectTime},</if>
|
|
|
|
|
<if test="collectTime != null">Collect_Time = #{collectTime},</if>-->
|
|
|
|
|
<if test="disposeFlag != null">Dispose_Flag = #{disposeFlag},</if>
|
|
|
|
|
<if test="disposeMode != null">Dispose_Mode = #{disposeMode},</if>
|
|
|
|
|
<if test="alarmReason != null">Alarm_Reason = #{alarmReason},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where Sensor_Id = #{sensorId}
|
|
|
|
|
where Alarm_Uid = #{alarmuid}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteRecordAlarmBySensorId" parameterType="String">
|
|
|
|
|
delete from record_alarm where Sensor_Id = #{sensorId}
|
|
|
|
|
delete from record_alarm where Alarm_Uid = #{alarmuid}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteRecordAlarmBySensorIds" parameterType="String">
|
|
|
|
|
delete from record_alarm where Sensor_Id in
|
|
|
|
|
delete from record_alarm where Alarm_Uid in
|
|
|
|
|
<foreach item="sensorId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{sensorId}
|
|
|
|
|
#{alarmuid}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
@ -111,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
t3.Sensor_Name,
|
|
|
|
|
t4.Min_Value,
|
|
|
|
|
t4.Max_Value,
|
|
|
|
|
t4.Alarm_Uid,
|
|
|
|
|
t4.Alarm_Value,
|
|
|
|
|
t4.Collect_Time,
|
|
|
|
|
t4.Dispose_Flag
|
|
|
|
|