<?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.ruoyi.system.mapper.AiStudyBatchMapper">
|
|
<resultMap type="AiStudyBatch" id="AiStudyBatchResult">
|
<result property="id" column="id" />
|
<result property="ruleId" column="rule_id" />
|
<result property="batchName" column="batch_name" />
|
<result property="edition" column="edition" />
|
<result property="remarks" column="remarks" />
|
<result property="deptId" column="dept_id" />
|
<result property="batchState" column="batch_state" />
|
<result property="delFlag" column="del_flag" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="fileName" column="file_name" />
|
<result property="deptName" column="dept_name" />
|
<result property="ruleName" column="rule_name" />
|
<result property="batchStateName" column="batch_state_name" />
|
</resultMap>
|
|
<sql id="selectAiStudyBatchVo">
|
select id, rule_id, batch_name, edition, remarks, dept_id, batch_state, del_flag, create_by, create_time, file_name from ai_study_batch
|
</sql>
|
|
<select id="selectAiStudyBatchList" parameterType="AiStudyBatch" resultMap="AiStudyBatchResult">
|
SELECT t1.id, t1.rule_id, t1.batch_name, t1.edition, t1.remarks, t1.dept_id, t1.batch_state, t1.del_flag, t1.create_by, t1.create_time, t1.file_name, t2.dept_name, (case t3.del_flag when 0 then t3.rule_name
|
when 1 then ''end)rule_name,(CASE t1.batch_state WHEN 1 THEN '数据准备' WHEN 2 THEN '数据标注' WHEN 3 THEN '模型训练' WHEN 4 THEN '模型部署' WHEN 5 THEN '应用上线' ELSE '数据准备' END)as batch_state_name
|
FROM ai_study_batch t1, sys_dept t2, ai_rule t3 WHERE t1.dept_id = t2.dept_id AND t3.id = t1.rule_id AND t1.del_flag=0
|
<if test="ruleId != null and ruleId != ''"> and t1.rule_id = #{ruleId}</if>
|
<if test="batchName != null and batchName != ''"> and t1.batch_name like concat('%', #{batchName}, '%')</if>
|
<if test="edition != null and edition != ''"> and t1.edition = #{edition}</if>
|
<if test="remarks != null and remarks != ''"> and t1.remarks = #{remarks}</if>
|
<if test="deptId != null and deptId != ''"> and t1.dept_id = #{deptId}</if>
|
<if test="batchState != null and batchState != ''"> and t1.batch_state = #{batchState}</if>
|
<if test="fileName != null and fileName != ''"> and t1.file_name like concat('%', #{fileName}, '%')</if>
|
</select>
|
|
<select id="selectAiStudyBatchById" parameterType="Long" resultMap="AiStudyBatchResult">
|
<include refid="selectAiStudyBatchVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertAiStudyBatch" parameterType="AiStudyBatch" useGeneratedKeys="true" keyProperty="id">
|
insert into ai_study_batch
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ruleId != null">rule_id,</if>
|
<if test="batchName != null">batch_name,</if>
|
<if test="edition != null">edition,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="deptId != null">dept_id,</if>
|
<if test="batchState != null">batch_state,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="fileName != null">file_name,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ruleId != null">#{ruleId},</if>
|
<if test="batchName != null">#{batchName},</if>
|
<if test="edition != null">#{edition},</if>
|
<if test="remarks != null">#{remarks},</if>
|
<if test="deptId != null">#{deptId},</if>
|
<if test="batchState != null">#{batchState},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="fileName != null">#{fileName},</if>
|
</trim>
|
</insert>
|
|
<update id="updateAiStudyBatch" parameterType="AiStudyBatch">
|
update ai_study_batch
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
<if test="batchName != null">batch_name = #{batchName},</if>
|
<if test="edition != null">edition = #{edition},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
<if test="batchState != null">batch_state = #{batchState},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="fileName != null">file_name = #{fileName},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteAiStudyBatchById" parameterType="Long">
|
delete from ai_study_batch where id = #{id}
|
</delete>
|
|
<delete id="deleteAiStudyBatchByIds" parameterType="String">
|
delete from ai_study_batch where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
<update id="updateDelFlagByIds" parameterType="String">
|
update ai_study_batch
|
set del_flag=1,update_by=#{userName},update_time=#{date}
|
where id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
<update id="updateDelFlagById" parameterType="String">
|
update ai_study_batch set del_flag=1,update_by=#{userName},update_time=#{date} where id=#{id}
|
</update>
|
</mapper>
|