<?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.taais.biz.mapper.AlgorithmModelMapper">

    <select id="getModelNameBySubtaskId" parameterType="Long" resultType="String">
        select
        (select att.name as taskName from algorithm_task att left join algorithm_subtask ast on att.id = ast.task_id where ast.id = ${subtaskId} limit 1)
        || '-' ||
        (select ac.algorithm_name from algorithm_config ac where ac.id = #{algorithmId} limit 1)
    </select>
    <select id="getModelByAlgorithmId" resultType="com.taais.biz.domain.vo.AlgorithmModelVo">
        select * from algorithm_model am where am.algorithm_id = #{algorithmId}
    </select>
    <select id="getModelById" resultType="com.taais.biz.domain.vo.AlgorithmModelVo">
        select * from algorithm_model am where am.id = #{id}
    </select>
</mapper>
