Files
intelligent-application-orc…/src/main/resources/mapper/ModelMapper.xml

59 lines
2.6 KiB
XML

<?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.bipt.intelligentapplicationorchestrationservice.mapper.ModelMapper">
<!--(新增新的模型)插入模型版本信息-->
<insert id="insertModelVersion">
insert into model_version (
model_id, version, dataset_id, model_config,
model_path, status, create_time, update_time, model_size,
data_pre_handle_file, model_super_args, model_args_size, model_source_code_url, model_file,
model_design_document, life_cycle, operate_user
)
values (
#{modelId}, #{version}, #{datasetId}, #{modelConfig},
#{modelPath}, #{status}, #{createTime}, #{updateTime}, #{modelSize},
#{dataPreHandleFile}, #{modelSuperArgs}, #{modelArgsSize}, #{modelSourceCodeUrl}, #{modelFile},
#{modelDesignDocument}, #{lifeCycle}, #{operateUser}
)
</insert>
<!--查询模型列表-->
<select id="list" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.ModelVO">
select t1.*,
t2.id as versionId,t2.version, t2.version, t2.data_pre_handle_file, t2.operate_user, t2.update_time,
t2.status
from model_info t1
left join model_version t2 on t1.id = t2.model_id
order by t2.update_time desc
</select>
<!--查询模型详细信息-->
<select id="selectById" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.ModelVersion">
SELECT
t1.model_name,
t2.version, t2.dataset_id, t2.model_config,
t2.model_path, t2.status, t2.create_time, t2.update_time, t2.model_size,
t2.data_pre_handle_file, t2.model_super_args, t2.model_args_size, t2.model_source_code_url, t2.model_file,
t2.model_design_document, t2.life_cycle, t2.operate_user
FROM model_info t1 JOIN model_version t2 ON t1.id = t2.model_id
where t2.id = #{id}
</select>
<!--更新模型信息-->
<update id="update">
UPDATE model_version
<set>
<if test="modelSize != null">
model_size = #{modelSize},
</if>
<if test="modelSuperArgs != null">
model_super_args = #{modelSuperArgs},
</if>
<if test="modelArgsSize != null">
model_args_size = #{modelArgsSize},
</if>
</set>
WHERE id = #{id
</update>
</mapper>