2024-11-25 10:56:55 +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.ReleaseVersionMapper">
|
|
|
|
|
<insert id="release">
|
|
|
|
|
INSERT INTO ai_dataset_version (version_name, version_description, dataset_id, task_id, create_by)
|
|
|
|
|
VALUES (#{versionName}, #{versionDesc}, #{datasetId}, #{taskId}, #{createBy});
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="delete">
|
|
|
|
|
update ai_dataset_version set del_flag='1' where version_id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="getAllReleaseVersions" resultType="com.bonus.ai.domain.dataset.ReleaseVersionEntity">
|
2024-11-27 12:19:34 +08:00
|
|
|
select atv.version_id AS versionId,
|
|
|
|
|
atv.version_name AS versionName,
|
|
|
|
|
atv.version_description AS versionDesc,
|
|
|
|
|
atv.dataset_id AS datasetId,
|
|
|
|
|
atv.task_id AS taskId,
|
|
|
|
|
atv.create_by AS createBy,
|
|
|
|
|
atv.create_time AS createTime,
|
|
|
|
|
aat.task_name as taskName,
|
|
|
|
|
ad.dataset_name as datasetName,
|
|
|
|
|
aat.annotation_type as annotationType,
|
2024-11-27 13:35:02 +08:00
|
|
|
su.user_name AS releaseUserName,
|
2024-11-27 12:19:34 +08:00
|
|
|
SUM(CASE WHEN ap.annotation_status = '2' or ap.annotation_status = '3' THEN 1 ELSE 0 END) AS auditedCount,
|
|
|
|
|
COUNT(*) AS totalCount
|
|
|
|
|
from ai_dataset_version atv
|
|
|
|
|
left join ai_annotation_task aat on aat.task_id = atv.task_id
|
|
|
|
|
left join ai_dataset ad on ad.dataset_id = atv.dataset_id
|
|
|
|
|
left join ai_annotation_task_annotator_map ap on atv.task_id = ap.task_id
|
2024-11-27 13:35:02 +08:00
|
|
|
left join sys_user su ON su.user_id = atv.create_by
|
2024-11-27 12:46:24 +08:00
|
|
|
where atv.del_flag = '0' and ap.annotation_status IN ('0', '1', '2','3') and atv.dataset_id =#{datasetId}
|
2024-11-27 12:19:34 +08:00
|
|
|
<if test="versionName != null and versionName != ''">
|
2024-12-02 11:18:59 +08:00
|
|
|
AND atv.version_name LIKE CONCAT('%', #{versionName}, '%')
|
2024-11-27 12:19:34 +08:00
|
|
|
</if>
|
2024-11-27 12:51:18 +08:00
|
|
|
GROUP BY ap.task_id, atv.create_time
|
|
|
|
|
ORDER BY atv.create_time DESC
|
|
|
|
|
|
2024-11-25 10:56:55 +08:00
|
|
|
</select>
|
|
|
|
|
</mapper>
|