package com.css.simulation.resource.server.infra.db.mysql.mapper;


import api.common.pojo.po.scheduler.SchedulerProjectPO;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface ManualProjectMapper {


    @Results(id = "project", value = {
            @Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
            @Result(column = "scene", property = "scenePackageId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_user_id", property = "createUserId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "parallelism", property = "parallelism", jdbcType = JdbcType.VARCHAR),
            @Result(column = "project_type", property = "projectType", jdbcType = JdbcType.VARCHAR)
    })
    @Select("select id, scene, create_user_id\n" +
            "from simulation_manual_project\n" +
            "where id = #{projectId}")
    SchedulerProjectPO selectById(@Param("projectId") String projectId);

    @Select("select details\n" +
            "from simulation_manual_project\n" +
            "where id = #{projectId}")
    String selectDetailsById(@Param("projectId") String projectId);

    @Update("update simulation_manual_project\n" +
            "set evaluation_level = #{evaluationLevel}\n" +
            "where id = #{projectId}")
    void updateEvaluationLevel(@Param("projectId") String projectId, @Param("evaluationLevel") String evaluationLevel);


}
