|
@@ -5,6 +5,8 @@ import com.css.simulation.resource.scheduler.pojo.po.AlgorithmPO;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
import org.apache.ibatis.type.JdbcType;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 场景查询
|
|
|
* scene_natural
|
|
@@ -14,7 +16,9 @@ import org.apache.ibatis.type.JdbcType;
|
|
|
@Mapper
|
|
|
public interface AlgorithmMapper {
|
|
|
|
|
|
- @Results(id = "index", value = {
|
|
|
+ @Results(id = "algorithm", value = {
|
|
|
+ @Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),
|
|
|
+ @Result(column = "algorithm_code", property = "algorithmCode", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "minio_path", property = "minioPath", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "docker_import", property = "dockerImport", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "docker_image", property = "dockerImage", jdbcType = JdbcType.VARCHAR),
|
|
@@ -23,7 +27,9 @@ public interface AlgorithmMapper {
|
|
|
@Result(column = "git_user_name", property = "gitUserName", jdbcType = JdbcType.VARCHAR),
|
|
|
@Result(column = "git_password", property = "gitPassword", jdbcType = JdbcType.VARCHAR)
|
|
|
})
|
|
|
- @Select("select minio_path,\n" +
|
|
|
+ @Select("select id,\n" +
|
|
|
+ " algorithm_code,\n" +
|
|
|
+ " minio_path,\n" +
|
|
|
" docker_import,\n" +
|
|
|
" docker_image,\n" +
|
|
|
" upload_mode,\n" +
|
|
@@ -31,13 +37,40 @@ public interface AlgorithmMapper {
|
|
|
" git_user_name,\n" +
|
|
|
" git_password\n" +
|
|
|
"from algorithm\n" +
|
|
|
- "where is_deleted = '0'\n" +
|
|
|
- " and id = #{id}")
|
|
|
+ "where id = #{id}")
|
|
|
AlgorithmPO selectById(@Param("id") String id);
|
|
|
|
|
|
+ @Select("select id,\n" +
|
|
|
+ " algorithm_code,\n" +
|
|
|
+ " minio_path,\n" +
|
|
|
+ " docker_import,\n" +
|
|
|
+ " docker_image,\n" +
|
|
|
+ " upload_mode,\n" +
|
|
|
+ " git_url,\n" +
|
|
|
+ " git_user_name,\n" +
|
|
|
+ " git_password\n" +
|
|
|
+ "from algorithm\n" +
|
|
|
+ "where docker_import = #{dockerImport}\n" +
|
|
|
+ "order by create_time desc")
|
|
|
+ List<AlgorithmPO> selectByDockerImport(@Param("dockerImport") String dockerImport);
|
|
|
+
|
|
|
@Update("update algorithm\n" +
|
|
|
"set docker_import = #{dockerImport},\n" +
|
|
|
" docker_image = #{dockerImage}\n" +
|
|
|
"where id = #{algorithmId}")
|
|
|
void updateDockerImportAndDockerImageById(@Param("dockerImport") String dockerImport, @Param("dockerImage") String dockerImage, @Param("algorithmId") String algorithmId);
|
|
|
+
|
|
|
+ @Update("<script>" +
|
|
|
+ "update algorithm\n" +
|
|
|
+ "set docker_import = #{dockerImport},\n" +
|
|
|
+ " docker_image = #{dockerImage}\n" +
|
|
|
+ "where 1 = 1\n" +
|
|
|
+ "<if test='idList != null and idList.size() > 0'>\n" +
|
|
|
+ " and id in\n" +
|
|
|
+ " <foreach collection='idList' index='index' item='item' open='(' close=')' separator=','>\n" +
|
|
|
+ " #{item}" +
|
|
|
+ " </foreach>\n" +
|
|
|
+ "</if>\n" +
|
|
|
+ "</script>")
|
|
|
+ void updateDockerImportAndDockerImageByIdList(@Param("dockerImport") String dockerImport, @Param("dockerImage") String dockerImage, @Param("idList") List<String> idList);
|
|
|
}
|