<?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.iot.mapper.BaseAlarmTypeMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.usky.iot.domain.BaseAlarmType">
        <id column="id" property="id" />
        <result column="type_code" property="typeCode" />
        <result column="type_abbrevia" property="typeAbbrevia" />
        <result column="type_name" property="typeName" />
        <result column="type_img" property="typeImg" />
        <result column="alarm_desc" property="alarmDesc" />
        <result column="delete_flag" property="deleteFlag" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="dept_id" property="deptId" />
        <result column="tenant_id" property="tenantId" />
    </resultMap>
    <select id="getAlarmInfo" resultType="com.usky.iot.domain.BaseAlarm">
        select
        distinct alarm_type
        from base_alarm
        <where>
            <if test="tenantId != null">
                and tenant_id = #{tenantId}
            </if>
        </where>
    </select>

</mapper>
