123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <?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" >
- <!--添加-->
- <insert id="add" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
- insert into algorithm
- (
- id,
- algorithm_name,
- description,
- validation_status,
- upload_mode,
- git_url,
- git_token,
- file_name,
- minio_path,
- share,
- create_time,
- create_user_id,
- modify_time,
- modify_user_id,
- is_deleted
- )
- value
- (
- #{id,jdbcType=VARCHAR},
- #{algorithmName,jdbcType=VARCHAR},
- #{description,jdbcType=LONGNVARCHAR},
- #{validationStatus,jdbcType=VARCHAR},
- #{uploadMode,jdbcType=VARCHAR},
- #{gitUrl,jdbcType=VARCHAR},
- #{gitToken,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="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
- select *
- from algorithm
- where id=#{id,jdbcType=VARCHAR}
- </select>
- <!--查询算法列表—私有-->
- <select id="selectAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
- select id, algorithm_name, description, validation_status, upload_mode from algorithm
- <where>
- is_deleted = '0' and share = '0'
- </where>
- <if test="id != null and id != ''">
- and id like CONCAT('%',#{id,jdbcType=VARCHAR},'%')
- </if>
- <if test="algorithmName != null and algorithmName != ''">
- and algorithm_name like CONCAT('%',#{algorithmName,jdbcType=VARCHAR},'%')
- </if>
- <if test="description != null and description != ''">
- and description like CONCAT('%',#{description,jdbcType=LONGNVARCHAR},'%')
- </if>
- <if test="validationStatus != null and validationStatus != ''">
- and validation_status = #{validationStatus,jdbcType=VARCHAR}
- </if>
- <if test="uploadMode != null and uploadMode != ''">
- and upload_mode = #{uploadMode,jdbcType=VARCHAR}
- </if>
- <if test="createUserId != null and createUserId != ''">
- and create_user_id = #{createUserId,jdbcType=VARCHAR}
- </if>
- order by modify_time desc, create_time desc
- </select>
- <!--查询绑定算法的正在运行的项目-->
- <select id="selectRunningProject" parameterType="java.lang.String" resultType="api.common.pojo.vo.algorithm.RunningProjectVO">
- select project_id from simulation_manual_project
- where now_run_state = '20' and is_deleted = '0'
- <if test="id != null and id != ''">
- and algorithm = #{id,jdbcType=VARCHAR}
- </if>
- </select>
- <!--查询算法名称是否已存在-当前用户-->
- <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}
- </if>
- <if test="createUserId != null and createUserId != ''">
- and create_user_id = #{createUserId,jdbcType=VARCHAR}
- </if>
- <if test="id != null and id != ''">
- and id != #{id,jdbcType=VARCHAR}
- </if>
- </select>
- <!--查询算法列表—公有-->
- <select id="selectSharedAlgorithmList" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
- select id, algorithm_name, description, validation_status, upload_mode from algorithm
- <where>
- is_deleted = '0'
- </where>
- <if test="id != null and id != ''">
- and id like CONCAT('%',#{id,jdbcType=VARCHAR},'%')
- </if>
- <if test="algorithmName != null and algorithmName != ''">
- and algorithm_name like CONCAT('%',#{algorithmName,jdbcType=VARCHAR},'%')
- </if>
- <if test="description != null and description != ''">
- and description like CONCAT('%',#{description,jdbcType=LONGNVARCHAR},'%')
- </if>
- <if test="validationStatus != null and validationStatus != ''">
- and validation_status = #{validationStatus,jdbcType=VARCHAR}
- </if>
- <if test="share != null and share != ''">
- and share = #{share,jdbcType=VARCHAR}
- </if>
- order by modify_time desc, create_time desc
- </select>
- <!--查询算法名称是否已存在-公有-->
- <select id="selectSharedAlgorithmName" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
- select id from algorithm
- where is_deleted = '0' and share = '1'
- <if test="algorithmName != null and algorithmName != ''">
- and algorithm_name = #{algorithmName,jdbcType=VARCHAR}
- </if>
- </select>
- <!--删除-->
- <update id="deleteByid">
- update algorithm
- set is_deleted='1'
- where id = #{id,jdbcType=VARCHAR}
- </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_token=#{gitToken,jdbcType=VARCHAR},
- file_name=#{fileName,jdbcType=VARCHAR},
- minio_path=#{minioPath,jdbcType=VARCHAR},
- linux_path=#{linuxPath,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 count(id)
- from algorithm
- where
- is_deleted = '0'
- <if test="createUserId != null and createUserId != ''">
- and create_user_id=#{createUserId,jdbcType=VARCHAR}
- </if>
- <if test="share != null and share != ''">
- and share=#{share}
- </if>
- <if test="uploadMode != null and uploadMode != ''">
- and upload_mode=#{uploadMode}
- </if>
- </select>
- </mapper>
|