<?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.RelationMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.Relation">
        <id column="id" property="id" />
        <result column="start_id" property="startId" />
        <result column="relation_id" property="relationId" />
        <result column="end_id" property="endId" />
    </resultMap>

    <select id="getRelation" parameterType="com.diagbot.dto.RelationDTO" resultType="com.diagbot.dto.RelationDTO">
        SELECT id, start_id, relation_id, end_id
        FROM relation
        WHERE start_id = #{startId} AND end_id = #{endId}
    </select>
</mapper>
