<?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.diagbot.mapper.LibraryMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.Library">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="type" property="type" />
        <result column="synony" property="synony" />
    </resultMap>

    <select id="getLibrary" parameterType="com.diagbot.vo.TermVo" resultType="com.diagbot.dto.LibraryDTO">
        SELECT
        a.id,
        a.name as term,
        a.synony as synonymous
        FROM library_info a
        LEFT JOIN lexicon b on a.type = b.id
        WHERE a.name = #{term}
    </select>



</mapper>
