<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.jilinsscgsdp.SysDict" name="app业务">

    <select id="getEventCategoryAndEventType" resultType="map">
        SELECT
        sd.`value` eventCategoryId,
        sd.label eventCategoryName,
        sd1.`value`eventTypeId,
        sd1.label eventTypeName
        FROM
        sys_dict sd
        LEFT JOIN sys_dict sd1 ON sd.id = sd1.`parent_id`
        WHERE
        sd.type = 'event_category'
        AND sd1.type = 'event_category'
    </select>

    <select id="getNameByEventCategoryId" parameterType="String" resultType="String">
        select label from sys_dict where type = 'event_category' and `value` = #{eventCategoryId} and parent_id = '0'
    </select>
    <select id="getNameByEventTypeId" parameterType="String" resultType="String">
        select label from sys_dict where type = 'event_category' and `value` = #{eventTypeId} and parent_id != '0'
    </select>
</mapper>
