<?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.ruoyi.dataprocess.mapper.HwAlarmInfoMapper">
    
    <resultMap type="HwAlarmInfo" id="HwAlarmInfoResult">
        <result property="alarmInfoId"    column="alarm_info_id"    />
        <result property="alarmInfoType"    column="alarm_info_type"    />
        <result property="alarmReleatedId"    column="alarm_releated_id"    />
        <result property="deviceId"    column="device_id"    />
        <result property="monitorUnitId"    column="monitor_unit_id"    />
        <result property="sceneId"    column="scene_id"    />
        <result property="alarmLevelId"    column="alarm_level_id"    />
        <result property="alarmTypeId"    column="alarm_type_id"    />
        <result property="modeFunctionId"    column="mode_function_id"    />
        <result property="functionName"    column="function_name"    />
        <result property="functionIdentifier"    column="function_identifier"    />
        <result property="functionValue"    column="function_value"    />
        <result property="triggerStatus"    column="trigger_status"    />
        <result property="handleStatus"    column="handle_status"    />
        <result property="alarmTime"    column="alarm_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="alarmInfoField"    column="alarm_info_field"    />
    </resultMap>

        
    <insert id="insertHwAlarmInfo" parameterType="HwAlarmInfo" useGeneratedKeys="true" keyProperty="alarmInfoId">
        insert into hw_alarm_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="alarmInfoType != null and alarmInfoType != ''">alarm_info_type,</if>
            <if test="alarmReleatedId != null">alarm_releated_id,</if>
            <if test="deviceId != null">device_id,</if>
            <if test="monitorUnitId != null">monitor_unit_id,</if>
            <if test="sceneId != null">scene_id,</if>
            <if test="alarmLevelId != null">alarm_level_id,</if>
            <if test="alarmTypeId != null">alarm_type_id,</if>
            <if test="modeFunctionId != null">mode_function_id,</if>
            <if test="functionName != null">function_name,</if>
            <if test="functionIdentifier != null">function_identifier,</if>
            <if test="functionValue != null">function_value,</if>
            <if test="triggerStatus != null">trigger_status,</if>
            <if test="handleStatus != null and handleStatus != ''">handle_status,</if>
            <if test="alarmTime != null">alarm_time,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="alarmInfoField != null">alarm_info_field,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="alarmInfoType != null and alarmInfoType != ''">#{alarmInfoType},</if>
            <if test="alarmReleatedId != null">#{alarmReleatedId},</if>
            <if test="deviceId != null">#{deviceId},</if>
            <if test="monitorUnitId != null">#{monitorUnitId},</if>
            <if test="sceneId != null">#{sceneId},</if>
            <if test="alarmLevelId != null">#{alarmLevelId},</if>
            <if test="alarmTypeId != null">#{alarmTypeId},</if>
            <if test="modeFunctionId != null">#{modeFunctionId},</if>
            <if test="functionName != null">#{functionName},</if>
            <if test="functionIdentifier != null">#{functionIdentifier},</if>
            <if test="functionValue != null">#{functionValue},</if>
            <if test="triggerStatus != null">#{triggerStatus},</if>
            <if test="handleStatus != null and handleStatus != ''">#{handleStatus},</if>
            <if test="alarmTime != null">#{alarmTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="alarmInfoField != null">#{alarmInfoField},</if>
         </trim>
    </insert>


</mapper>