|
@@ -1,61 +1,60 @@
|
|
|
<?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.css.simulation.resource.algorithm.mapper.AlgorithmMapper" >
|
|
|
+<mapper namespace="com.css.simulation.resource.algorithm.mapper.AlgorithmMapper">
|
|
|
|
|
|
|
|
|
<!--添加-->
|
|
|
<insert id="add" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
insert into algorithm
|
|
|
- (
|
|
|
- id,
|
|
|
- algorithm_name,
|
|
|
- algorithm_code,
|
|
|
- description,
|
|
|
- validation_status,
|
|
|
- upload_mode,
|
|
|
- git_url,
|
|
|
- git_user_name,
|
|
|
- git_password,
|
|
|
- file_name,
|
|
|
- minio_path,
|
|
|
- share,
|
|
|
- create_time,
|
|
|
- create_user_id,
|
|
|
- modify_time,
|
|
|
- modify_user_id,
|
|
|
- is_deleted
|
|
|
- )
|
|
|
- value
|
|
|
- (
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- #{algorithmName,jdbcType=VARCHAR},
|
|
|
- #{algorithmCode,jdbcType=VARCHAR},
|
|
|
- #{description,jdbcType=LONGNVARCHAR},
|
|
|
- #{validationStatus,jdbcType=VARCHAR},
|
|
|
- #{uploadMode,jdbcType=VARCHAR},
|
|
|
- #{gitUrl,jdbcType=VARCHAR},
|
|
|
- #{gitUserName,jdbcType=VARCHAR},
|
|
|
- #{gitPassword,jdbcType=VARCHAR},
|
|
|
- #{fileName,jdbcType=VARCHAR},
|
|
|
- #{minioPath,jdbcType=VARCHAR},
|
|
|
- #{share,jdbcType=VARCHAR},
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{createUserId,jdbcType=VARCHAR},
|
|
|
- #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
- #{modifyUserId,jdbcType=VARCHAR},
|
|
|
- #{isDeleted,jdbcType=VARCHAR}
|
|
|
- )
|
|
|
+ (id,
|
|
|
+ algorithm_name,
|
|
|
+ algorithm_code,
|
|
|
+ description,
|
|
|
+ validation_status,
|
|
|
+ upload_mode,
|
|
|
+ git_url,
|
|
|
+ git_user_name,
|
|
|
+ git_password,
|
|
|
+ file_name,
|
|
|
+ minio_path,
|
|
|
+ share,
|
|
|
+ create_time,
|
|
|
+ create_user_id,
|
|
|
+ modify_time,
|
|
|
+ modify_user_id,
|
|
|
+ is_deleted)
|
|
|
+ value
|
|
|
+ ( #{id,jdbcType=VARCHAR},
|
|
|
+ #{algorithmName,jdbcType=VARCHAR},
|
|
|
+ #{algorithmCode,jdbcType=VARCHAR},
|
|
|
+ #{description,jdbcType=LONGNVARCHAR},
|
|
|
+ #{validationStatus,jdbcType=VARCHAR},
|
|
|
+ #{uploadMode,jdbcType=VARCHAR},
|
|
|
+ #{gitUrl,jdbcType=VARCHAR},
|
|
|
+ #{gitUserName,jdbcType=VARCHAR},
|
|
|
+ #{gitPassword,jdbcType=VARCHAR},
|
|
|
+ #{fileName,jdbcType=VARCHAR},
|
|
|
+ #{minioPath,jdbcType=VARCHAR},
|
|
|
+ #{share,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{createUserId,jdbcType=VARCHAR},
|
|
|
+ #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
+ #{modifyUserId,jdbcType=VARCHAR},
|
|
|
+ #{isDeleted,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
</insert>
|
|
|
|
|
|
<!--查询算法详情-->
|
|
|
- <select id="selectDetailsById" parameterType="java.lang.String" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
+ <select id="selectDetailsById" parameterType="java.lang.String"
|
|
|
+ resultType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
select *
|
|
|
from algorithm
|
|
|
- where id=#{algorithmId,jdbcType=VARCHAR}
|
|
|
+ where id = #{algorithmId,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
<!--查询算法列表—私有-->
|
|
|
- <select id="selectAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
|
|
|
+ <select id="selectAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter"
|
|
|
+ resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
|
|
|
select id, algorithm_code, algorithm_name, description, validation_status, upload_mode from algorithm
|
|
|
<where>
|
|
|
is_deleted = '0' and share = '0'
|
|
@@ -82,31 +81,44 @@
|
|
|
</select>
|
|
|
|
|
|
<!--查询绑定算法的正在运行的项目-->
|
|
|
- <select id="selectRunningProject" parameterType="java.lang.String" resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
|
|
|
- select a.id,a.project_id from simulation_automatic_subproject a left join simulation_automatic_project b
|
|
|
+ <select id="selectRunningProject" parameterType="java.lang.String"
|
|
|
+ resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
|
|
|
+ select a.id,a.project_id from simulation_automatic_subproject a left join simulation_automatic_project b
|
|
|
on a.parent_id=b.id
|
|
|
- where a.now_run_state = '20' and a.is_deleted = '0' and b.is_deleted = '0'
|
|
|
+ where a.now_run_state = '20' and a.is_deleted = '0' and b.is_deleted = '0'
|
|
|
<if test="id != null and id != ''">
|
|
|
- and b.algorithm = #{id,jdbcType=VARCHAR}
|
|
|
+ and b.algorithm = #{id,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<!--查询绑定算法的正在运行的项目的父项目-->
|
|
|
- <select id="selectRunningProjectParent" parameterType="java.lang.String" resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
|
|
|
- select distinct a.parent_id as id,a.parent_project_id as projectId from simulation_automatic_subproject a left join simulation_automatic_project b
|
|
|
+ <select id="selectRunningProjectParent" parameterType="java.lang.String"
|
|
|
+ resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
|
|
|
+ select distinct a.parent_id as id,a.parent_project_id as projectId from simulation_automatic_subproject a left
|
|
|
+ join simulation_automatic_project b
|
|
|
on a.parent_id=b.id
|
|
|
- where a.now_run_state = '20' and a.is_deleted = '0' and b.is_deleted = '0'
|
|
|
+ where a.now_run_state = '20' and a.is_deleted = '0' and b.is_deleted = '0'
|
|
|
<if test="id != null and id != ''">
|
|
|
- and b.algorithm = #{id,jdbcType=VARCHAR}
|
|
|
+ and b.algorithm = #{id,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!--查询算法绑定的自动运行父项目-->
|
|
|
+ <select id="selectAutoProjectIdByAlgorithmId" parameterType="java.lang.String"
|
|
|
+ resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
|
|
|
+ select id, project_id
|
|
|
+ from simulation_automatic_project
|
|
|
+ where is_deleted = '0'
|
|
|
+ and algorithm = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--查询算法名称是否已存在-当前用户-->
|
|
|
- <select id="selectAlgorithmName" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
- select id from algorithm
|
|
|
+ <select id="selectAlgorithmName" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter"
|
|
|
+ resultType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
+ select id from algorithm
|
|
|
where is_deleted = '0'
|
|
|
<if test="algorithmName != null and algorithmName != ''">
|
|
|
- and algorithm_name = #{algorithmName,jdbcType=VARCHAR}
|
|
|
+ and algorithm_name = #{algorithmName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="createUserId != null and createUserId != ''">
|
|
|
and create_user_id = #{createUserId,jdbcType=VARCHAR}
|
|
@@ -121,7 +133,8 @@
|
|
|
|
|
|
|
|
|
<!--查询算法列表—公有-->
|
|
|
- <select id="selectSharedAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
|
|
|
+ <select id="selectSharedAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter"
|
|
|
+ resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
|
|
|
select id, algorithm_code, algorithm_name, description, validation_status, upload_mode from algorithm
|
|
|
<where>
|
|
|
is_deleted = '0'
|
|
@@ -146,10 +159,10 @@
|
|
|
|
|
|
<!--查询算法名称是否已存在-公有-->
|
|
|
<select id="selectSharedAlgorithmName" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
- select id from algorithm
|
|
|
+ select id from algorithm
|
|
|
where is_deleted = '0' and share = '1'
|
|
|
<if test="algorithmName != null and algorithmName != ''">
|
|
|
- and algorithm_name = #{algorithmName,jdbcType=VARCHAR}
|
|
|
+ and algorithm_name = #{algorithmName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -161,23 +174,24 @@
|
|
|
</update>
|
|
|
|
|
|
<update id="update" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
|
|
|
- update algorithm set
|
|
|
- algorithm_name=#{algorithmName,jdbcType=VARCHAR},
|
|
|
- description=#{description,jdbcType=VARCHAR},
|
|
|
- validation_status=#{validationStatus,jdbcType=VARCHAR},
|
|
|
- upload_mode=#{uploadMode,jdbcType=VARCHAR},
|
|
|
- git_url=#{gitUrl,jdbcType=VARCHAR},
|
|
|
- git_user_name=#{gitUserName,jdbcType=VARCHAR},
|
|
|
- git_password=#{gitPassword,jdbcType=VARCHAR},
|
|
|
- file_name=#{fileName,jdbcType=VARCHAR},
|
|
|
- minio_path=#{minioPath,jdbcType=VARCHAR},
|
|
|
- modify_time=#{modifyTime,jdbcType=VARCHAR},
|
|
|
- modify_user_id=#{modifyUserId,jdbcType=VARCHAR}
|
|
|
- where id=#{id,jdbcType=VARCHAR}
|
|
|
+ update algorithm
|
|
|
+ set algorithm_name=#{algorithmName,jdbcType=VARCHAR},
|
|
|
+ description=#{description,jdbcType=VARCHAR},
|
|
|
+ validation_status=#{validationStatus,jdbcType=VARCHAR},
|
|
|
+ upload_mode=#{uploadMode,jdbcType=VARCHAR},
|
|
|
+ git_url=#{gitUrl,jdbcType=VARCHAR},
|
|
|
+ git_user_name=#{gitUserName,jdbcType=VARCHAR},
|
|
|
+ git_password=#{gitPassword,jdbcType=VARCHAR},
|
|
|
+ file_name=#{fileName,jdbcType=VARCHAR},
|
|
|
+ minio_path=#{minioPath,jdbcType=VARCHAR},
|
|
|
+ modify_time=#{modifyTime,jdbcType=VARCHAR},
|
|
|
+ modify_user_id=#{modifyUserId,jdbcType=VARCHAR}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
<!--查询算法数量首页-->
|
|
|
- <select id="selectDetailsBySy" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="java.lang.Integer">
|
|
|
+ <select id="selectDetailsBySy" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter"
|
|
|
+ resultType="java.lang.Integer">
|
|
|
select count(id)
|
|
|
from algorithm
|
|
|
where
|