Browse Source

修改实验对比分页查询

dev-czh
chenzhihang 1 year ago
parent
commit
02a3952d0b
2 changed files with 18 additions and 15 deletions
  1. +7
    -5
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AimServiceImpl.java
  2. +11
    -10
      ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ExperimentInsDaoMapper.xml

+ 7
- 5
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AimServiceImpl.java View File

@@ -190,11 +190,13 @@ public class AimServiceImpl implements AimService {
} }


//解析指标 //解析指标
Map<String, Object> metricValue = JacksonUtil.parseJSONStr2Map(experimentIns.getMetricValue());
if (isTrain) {
setMetricValue("train", metricValue, aimRunInfo);
} else {
setMetricValue("evaluate", metricValue, aimRunInfo);
if (StringUtils.isNotEmpty(experimentIns.getMetricValue())) {
Map<String, Object> metricValue = JacksonUtil.parseJSONStr2Map(experimentIns.getMetricValue());
if (isTrain) {
setMetricValue("train", metricValue, aimRunInfo);
} else {
setMetricValue("evaluate", metricValue, aimRunInfo);
}
} }
aimRunInfoList.add(aimRunInfo); aimRunInfoList.add(aimRunInfo);
} }


+ 11
- 10
ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ExperimentInsDaoMapper.xml View File

@@ -13,6 +13,7 @@
<result property="nodesLogs" column="nodes_logs" jdbcType="VARCHAR"/> <result property="nodesLogs" column="nodes_logs" jdbcType="VARCHAR"/>
<result property="globalParam" column="global_param" jdbcType="VARCHAR"/> <result property="globalParam" column="global_param" jdbcType="VARCHAR"/>
<result property="metricRecord" column="metric_record" jdbcType="VARCHAR"/> <result property="metricRecord" column="metric_record" jdbcType="VARCHAR"/>
<result property="metricValue" column="metric_value" jdbcType="VARCHAR"/>
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/> <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
<result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/> <result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/> <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
@@ -25,7 +26,7 @@


<!--查询非终止态的实例--> <!--查询非终止态的实例-->
<select id="queryByExperimentIsNotTerminated" resultMap="ExperimentInsMap"> <select id="queryByExperimentIsNotTerminated" resultMap="ExperimentInsMap">
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record,metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
where (status NOT IN ('Terminated', 'Succeeded', 'Failed') where (status NOT IN ('Terminated', 'Succeeded', 'Failed')
OR status IS NULL) and state = 1 OR status IS NULL) and state = 1
@@ -60,7 +61,7 @@


<!--查询列表--> <!--查询列表-->
<select id="getByExperimentId" resultMap="ExperimentInsMap"> <select id="getByExperimentId" resultMap="ExperimentInsMap">
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record,metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
where experiment_id = #{experiment_id} and state = 1 where experiment_id = #{experiment_id} and state = 1
order by update_time DESC order by update_time DESC
@@ -69,7 +70,7 @@


<!--查询最近的3个实例列表--> <!--查询最近的3个实例列表-->
<select id="getLatestInsList" resultMap="ExperimentInsMap"> <select id="getLatestInsList" resultMap="ExperimentInsMap">
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record,metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
where state = 1 where state = 1
order by create_time DESC order by create_time DESC
@@ -80,7 +81,7 @@


<select id="queryByExperiment" resultMap="ExperimentInsMap"> <select id="queryByExperiment" resultMap="ExperimentInsMap">
select select
id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record,metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
<where> <where>
state = 1 state = 1
@@ -135,7 +136,7 @@
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="ExperimentInsMap"> <select id="queryAllByLimit" resultMap="ExperimentInsMap">
select select
id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs,global_param,metric_record, metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
<where> <where>
state = 1 state = 1
@@ -244,23 +245,23 @@
</select> </select>


<select id="queryByExperimentId" resultMap="ExperimentInsMap"> <select id="queryByExperimentId" resultMap="ExperimentInsMap">
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record, start_time, finish_time, create_by, create_time, update_by, update_time, state
select id, experiment_id, argo_ins_name, argo_ins_ns, status, nodes_status,nodes_result, nodes_logs, global_param,metric_record,metric_value, start_time, finish_time, create_by, create_time, update_by, update_time, state
from experiment_ins from experiment_ins
where experiment_id = #{id} and state = 1 where experiment_id = #{id} and state = 1
</select> </select>


<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into experiment_ins(experiment_id,argo_ins_name,argo_ins_ns,status,nodes_status,nodes_result,nodes_logs,global_param,metric_record,start_time,finish_time,create_by,create_time,update_by,update_time,state)
values (#{experimentIns.experimentId},#{experimentIns.argoInsName},#{experimentIns.argoInsNs},#{experimentIns.status},#{experimentIns.nodesStatus},#{experimentIns.nodesResult},#{experimentIns.nodesLogs},#{experimentIns.globalParam},#{experimentIns.metricRecord},#{experimentIns.startTime},#{experimentIns.finishTime},#{experimentIns.createBy},#{experimentIns.createTime},#{experimentIns.updateBy},#{experimentIns.updateTime},#{experimentIns.state})
insert into experiment_ins(experiment_id,argo_ins_name,argo_ins_ns,status,nodes_status,nodes_result,nodes_logs,global_param,metric_record,metric_value,start_time,finish_time,create_by,create_time,update_by,update_time,state)
values (#{experimentIns.experimentId},#{experimentIns.argoInsName},#{experimentIns.argoInsNs},#{experimentIns.status},#{experimentIns.nodesStatus},#{experimentIns.nodesResult},#{experimentIns.nodesLogs},#{experimentIns.globalParam},#{experimentIns.metricRecord},#{experimentIns.metricValue},#{experimentIns.startTime},#{experimentIns.finishTime},#{experimentIns.createBy},#{experimentIns.createTime},#{experimentIns.updateBy},#{experimentIns.updateTime},#{experimentIns.state})
</insert> </insert>


<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into insert into
experiment_ins(experiment_id,argo_ins_name,argo_ins_ns,status,nodes_status,nodes_result,nodes_logs,global_param,metric_record,start_time,finish_time,create_by,create_time,update_by,update_time,state)
experiment_ins(experiment_id,argo_ins_name,argo_ins_ns,status,nodes_status,nodes_result,nodes_logs,global_param,metric_record,metric_value,start_time,finish_time,create_by,create_time,update_by,update_time,state)
values values
<foreach collection="entities" item="entity" separator=","> <foreach collection="entities" item="entity" separator=",">
(#{entity.experimentId},#{entity.argoInsName},#{entity.argoInsNs},#{entity.status},#{entity.nodesStatus},#{entity.nodesResult},#{entity.nodesLogs},#{entity.globalParam},#{entity.metricRecord},#{entity.startTime},#{entity.finishTime},#{entity.createBy},#{entity.createTime},#{entity.updateBy},#{entity.updateTime},#{entity.state})
(#{entity.experimentId},#{entity.argoInsName},#{entity.argoInsNs},#{entity.status},#{entity.nodesStatus},#{entity.nodesResult},#{entity.nodesLogs},#{entity.globalParam},#{entity.metricRecord},#{entity.metricValue},#{entity.startTime},#{entity.finishTime},#{entity.createBy},#{entity.createTime},#{entity.updateBy},#{entity.updateTime},#{entity.state})
</foreach> </foreach>
</insert> </insert>




Loading…
Cancel
Save