<?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.bonus.sgzb.material.mapper.ReportAlarmMapper">


    <insert id="add">
        insert into report_alarm(iot_code,device_alarm_id,start_alarm,start_alarm_time,whether_push)
        values(#{iotCode},#{deviceAlarmId},#{startAlarm},#{startAlarmTime},1)
    </insert>
    <update id="update">
        update report_alarm
        <set>
            <if test="whetherVerify != null">whether_verify = #{whetherVerify},</if>
            <if test="verifySituation != null">verify_situation = #{verifySituation},</if>
        </set>
        where device_alarm_id = #{deviceAlarmId}

    </update>
    <delete id="deleteById"></delete>
    <select id="selectByDeviceAlarmId" resultType="com.bonus.sgzb.material.domain.ReportAlarm">
        select * from report_alarm where device_alarm_id = #{DeviceAlarmId}
    </select>
    <select id="selectByIotCode" resultType="com.bonus.sgzb.material.domain.ReportAlarm">
        select * from report_alarm where iot_code = #{iotCode}
    </select>
</mapper>