<?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.yfd.platform.system.mapper.SysDictionaryItemsMapper">
    <select id="getDictItemByType" resultType="com.yfd.platform.system.domain.SysDictionaryItems">
    SELECT
        di.*
    FROM
        sys_dictionary_items di
        INNER JOIN sys_dictionary d ON di.dictid = d.id
    WHERE
        d.dictcode = #{dictcode}
        AND di.itemcode = #{alarmType}
        limit 1
    </select>
    <select id="getDeviceMapByType" resultType="java.util.Map">
    SELECT
      JSON_OBJECTAGG(di.itemcode, di.dictname) AS result_map
    FROM
      sys_dictionary_items di
      INNER JOIN sys_dictionary d ON di.dictid = d.id
    WHERE
      d.dictcode = #{dictcode};
    </select>
</mapper>
