<?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="org.springblade.homecare.alarmlist.mapper.AlarmMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="alarmResultMap" type="org.springblade.homecare.alarmlist.entity.Alarm">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>

        <result column="alarm_id" property="alarmId"/>
        <result column="alarm_times" property="alarmTimes"/>
        <result column="level" property="level"/>
        <result column="name" property="name"/>
        <result column="device_id" property="deviceId"/>
        <result column="device_name" property="deviceName"/>
        <result column="record_time" property="recordTime"/>
        <result column="device_type" property="deviceType"/>

        <result column="alarm_type" property="alarmType"/>
        <result column="app_id" property="appId"/>
        <result column="prefix" property="prefix"/>
        <result column="order_id" property="orderId"/>
        <result column="metric" property="metric"/>
        <result column="alarm_type_splice" property="alarmTypeSplice"/>
        <result column="alarm_desc" property="alarmDesc"/>
        <result column="is_alarm" property="isAlarm"/>
        <result column="alarm_metric" property="alarmMetric"/>
        <result column="alarm_value" property="alarmValue"/>
        <result column="last_sync_date" property="lastSyncDate"/>
        <result column="last_notice_date" property="lastNoticeDate"/>
        <result column="tenant_id" property="tenantId"/>

        <result column="org_position" property="orgPosition"/>
    </resultMap>


    <select id="selectAlarmPage" resultMap="alarmResultMap">
        select * from iot_alarm where is_deleted = 0
    </select>

</mapper>
