<?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.usky.alarm.mapper.BaseAlarmMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.alarm.domain.BaseAlarm">
        <id column="id" property="id" />
        <result column="device_id" property="deviceId" />
        <result column="alarm_time" property="alarmTime" />
        <result column="alarm_type" property="alarmType" />
        <result column="alarm_object" property="alarmObject" />
        <result column="alarm_data" property="alarmData" />
        <result column="alarm_attribute" property="alarmAttribute" />
        <result column="alarm_content" property="alarmContent" />
        <result column="alarm_grade" property="alarmGrade" />
        <result column="alarm_address" property="alarmAddress" />
        <result column="handle_by" property="handleBy" />
        <result column="handle_time" property="handleTime" />
        <result column="handle_content" property="handleContent" />
        <result column="handle_phone" property="handlePhone" />
        <result column="handle_status" property="handleStatus" />
        <result column="alarm_false" property="alarmFalse" />
        <result column="site_photo" property="sitePhoto" />
        <result column="product_code" property="productCode" />
        <result column="dept_id" property="deptId" />
        <result column="tenant_id" property="tenantId" />
    </resultMap>
    <select id="getAlarmTypeOne" resultType="com.usky.alarm.domain.BaseAlarmType">
        select
        *
        from base_alarm_type
        <where>
            <if test="alarmType != null">
                and type_code = #{alarmType}
            </if>
            <if test="1 == 1">
                and delete_flag = 0
            </if>
        </where>
    </select>
</mapper>
