You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
4.1 KiB
XML
84 lines
4.1 KiB
XML
|
5 months ago
|
<?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="org.dromara.ai.mapper.AiBaseModelMapper">
|
||
|
|
|
||
|
|
<resultMap type="AiBaseModel" id="AiBaseModelResult">
|
||
|
|
<result property="baseModelId" column="base_model_id" />
|
||
|
|
<result property="baseModelName" column="base_model_name" />
|
||
|
|
<result property="modelTypeId" column="model_type_id" />
|
||
|
|
<result property="modelTypeCode" column="model_type_code" />
|
||
|
|
<result property="contextLength" column="context_length" />
|
||
|
|
<result property="activeFlag" column="active_flag" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
<result property="baseModelDescription" column="base_model_description" />
|
||
|
|
<result property="modelTypeName" column="model_type_name" />
|
||
|
|
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
|
||
|
|
<resultMap id="AiBaseModelApiEndpointCapabilityResult" type="AiBaseModel"
|
||
|
|
extends="AiBaseModelResult">
|
||
|
|
<collection property="aiApiEndpointList" notNullColumn="sub_point_base_model_id" javaType="java.util.List"
|
||
|
|
resultMap="AiApiEndpointResult"/>
|
||
|
|
<collection property="aiModelCapabilityList" notNullColumn="sub_capability_base_model_id" javaType="java.util.List"
|
||
|
|
resultMap="AiModelCapabilityResult"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
|
||
|
|
<resultMap type="AiApiEndpoint" id="AiApiEndpointResult">
|
||
|
|
<result property="apiEndpointId" column="sub_api_endpoint_id"/>
|
||
|
|
<result property="baseModelId" column="sub_point_base_model_id"/>
|
||
|
|
<result property="apiEndpointName" column="sub_api_endpoint_name"/>
|
||
|
|
<result property="apiVersion" column="sub_api_version"/>
|
||
|
|
<result property="httpMethod" column="sub_http_method"/>
|
||
|
|
<result property="apiEndpointPath" column="sub_api_endpoint_path"/>
|
||
|
|
<result property="defaultFlag" column="sub_default_flag"/>
|
||
|
|
<result property="rateLimit" column="sub_rate_limit"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<resultMap type="AiModelCapability" id="AiModelCapabilityResult">
|
||
|
|
<result property="modelCapabilityId" column="sub_model_capability_id"/>
|
||
|
|
<result property="baseModelId" column="sub_capability_base_model_id"/>
|
||
|
|
<result property="modelCapabilityName" column="sub_model_capability_name"/>
|
||
|
|
<result property="modelCapabilityDescription" column="sub_model_capability_description"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<select id="selectAiBaseModelJoinList" parameterType="AiBaseModel"
|
||
|
|
resultMap="AiBaseModelApiEndpointCapabilityResult">
|
||
|
|
select a.base_model_id,
|
||
|
|
a.base_model_name,
|
||
|
|
a.model_type_id,
|
||
|
|
a.context_length,
|
||
|
|
a.active_flag,
|
||
|
|
a.base_model_description,
|
||
|
|
amt.model_type_code,
|
||
|
|
amt.model_type_name,
|
||
|
|
b.base_model_id as sub_point_base_model_id,
|
||
|
|
b.api_endpoint_id as sub_api_endpoint_id,
|
||
|
|
b.api_endpoint_name as sub_api_endpoint_name,
|
||
|
|
b.api_version as sub_api_version,
|
||
|
|
b.http_method as sub_http_method,
|
||
|
|
b.api_endpoint_path as sub_api_endpoint_path,
|
||
|
|
b.default_flag as sub_default_flag,
|
||
|
|
b.rate_limit as sub_rate_limit,
|
||
|
|
c.model_capability_id as sub_model_capability_id,
|
||
|
|
c.base_model_id as sub_capability_base_model_id,
|
||
|
|
c.model_capability_name as sub_model_capability_name,
|
||
|
|
c.model_capability_description as sub_model_capability_description
|
||
|
|
from ai_base_model a
|
||
|
|
left join ai_api_endpoint b on b.base_model_id = a.base_model_id
|
||
|
|
left join ai_model_capability c on c.base_model_id = a.base_model_id
|
||
|
|
left join ai_model_type amt on a.model_type_id = amt.model_type_id
|
||
|
|
<where>
|
||
|
|
<if test="platformId != null and platformId != ''">and a.platform_id = #{platformId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|