You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
exam/mapper/sys/system/SysDictMapper.xml

17 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!-- 声明 XML 文档版本为 1.0,指定字符编码为 UTF-8确保文档能正确处理各种字符 -->
<?xml version="1.0" encoding="UTF-8"?>
<!-- 定义文档类型,引用 MyBatis Mapper 3.0 的 DTD用于验证当前 XML 文档是否符合 MyBatis Mapper 规范 -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 定义 Mapper 命名空间,将此 XML 映射文件与对应的 Java Mapper 接口关联起来,方便 MyBatis 找到对应的操作方法 -->
<mapper namespace="com.yf.exam.modules.sys.system.mapper.SysDictMapper">
<!-- 定义一个查询方法,方法名为 findDict将查询结果映射为 String 类型 -->
<!-- 该方法用于从指定表中根据键值对查询单个字段的值 -->
<select id="findDict" resultType="String">
<!-- 使用动态参数构建 SQL 语句,从指定表中查询指定字段 -->
<!-- 注意:使用 ${} 进行参数替换,存在 SQL 注入风险 -->
SELECT ${text} FROM ${table} WHERE ${key}=${value} LIMIT 1
</select>
</mapper>