<?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.jeeplus.sys.mapper.DictValueMapper">


    <select id="getByName" resultType="com.jeeplus.sys.domain.DictValue">
        SELECT v.label,
               v.value,
               v.sort
        FROM `sys_dict_value` v
         LEFT JOIN `sys_dict_type` t ON v.dict_type_id = t.id
        WHERE t.type = #{dictName}
          AND t.del_flag = 0
          AND v.del_flag = 0
    </select>

    <update id="updateDictValue">
        UPDATE sys_dict_value SET
          value = #{value},
          update_time = now()
          WHERE label = #{label} AND del_flag = 0
    </update>


    <select id="getRealTimeDictValue" resultType="string">
        select a.value
        from sys_dict_value a
        where a.label = #{label} and
            a.del_flag = 0
    </select>



</mapper>
