2024-11-18 09:07:00 +08:00
|
|
|
<?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.bonus.ai.mapper.DataSetLabelsMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.bonus.ai.domain.DataSetLabels" id="DataSetLabelsResult">
|
|
|
|
|
<result property="labelId" column="label_id" />
|
|
|
|
|
<result property="ancestors" column="ancestors" />
|
|
|
|
|
<result property="parentId" column="parent_id" />
|
|
|
|
|
<result property="labelName" column="label_name" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectDataSetLabelsVo">
|
|
|
|
|
select label_id, ancestors, parent_id, label_name, del_flag, create_by, update_by, update_time, create_time from ai_labels
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectDataSetLabelsList" parameterType="com.bonus.ai.domain.DataSetLabels" resultMap="DataSetLabelsResult">
|
|
|
|
|
<include refid="selectDataSetLabelsVo"/>
|
|
|
|
|
<where>
|
2024-11-25 10:56:55 +08:00
|
|
|
del_flag ='0'
|
2024-11-18 09:07:00 +08:00
|
|
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
|
|
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
|
|
<if test="labelName != null "> and label_name like concat('%', #{labelName}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectDataSetLabelsByLabelId" parameterType="Long" resultMap="DataSetLabelsResult">
|
|
|
|
|
<include refid="selectDataSetLabelsVo"/>
|
|
|
|
|
where label_id = #{labelId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertDataSetLabels" parameterType="com.bonus.ai.domain.DataSetLabels" useGeneratedKeys="true" keyProperty="labelId">
|
|
|
|
|
insert into ai_labels
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="ancestors != null">ancestors,</if>
|
|
|
|
|
<if test="parentId != null">parent_id,</if>
|
|
|
|
|
<if test="labelName != null">label_name,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="ancestors != null">#{ancestors},</if>
|
|
|
|
|
<if test="parentId != null">#{parentId},</if>
|
|
|
|
|
<if test="labelName != null">#{labelName},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateDataSetLabels" parameterType="com.bonus.ai.domain.DataSetLabels">
|
|
|
|
|
update ai_labels
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
|
|
<if test="labelName != null">label_name = #{labelName},</if>
|
|
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where label_id = #{labelId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
2024-11-25 10:56:55 +08:00
|
|
|
<update id="deleteDataSetLabelsByLabelIds" parameterType="String">
|
|
|
|
|
update ai_labels set del_flag ='1' where label_id in
|
2024-11-18 09:07:00 +08:00
|
|
|
<foreach item="labelId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{labelId}
|
|
|
|
|
</foreach>
|
2024-11-25 10:56:55 +08:00
|
|
|
</update>
|
2024-11-18 09:07:00 +08:00
|
|
|
</mapper>
|