提交代码实现v1.0
This commit is contained in:
50
src/main/resources/mapper/AnnotationResultMapper.xml
Normal file
50
src/main/resources/mapper/AnnotationResultMapper.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.labelsys.backend.mapper.AnnotationResultMapper">
|
||||
<resultMap id="AnnotationResultResultMap" type="com.labelsys.backend.entity.AnnotationResult">
|
||||
<id column="id" property="id"/>
|
||||
<result column="company_id" property="companyId"/>
|
||||
<result column="creator_id" property="creatorId"/>
|
||||
<result column="creator_role" property="creatorRole"/>
|
||||
<result column="task_id" property="taskId"/>
|
||||
<result column="resource_id" property="resourceId"/>
|
||||
<result column="qa_content_json" property="qaContentJson"/>
|
||||
<result column="qa_content_storage_mode" property="qaContentStorageMode"/>
|
||||
<result column="qa_content_file_path" property="qaContentFilePath"/>
|
||||
<result column="diff_summary" property="diffSummary"/>
|
||||
<result column="requires_manual_review" property="requiresManualReview"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="reviewer_id" property="reviewerId"/>
|
||||
<result column="review_comment" property="reviewComment"/>
|
||||
<result column="reviewed_at" property="reviewedAt"/>
|
||||
<result column="created_at" property="createdAt"/>
|
||||
<result column="updated_at" property="updatedAt"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="AnnotationResultColumns">
|
||||
id, company_id, creator_id, creator_role, task_id, resource_id, qa_content_json,
|
||||
qa_content_storage_mode, qa_content_file_path, diff_summary, requires_manual_review,
|
||||
is_deleted, reviewer_id, review_comment, reviewed_at, created_at, updated_at
|
||||
</sql>
|
||||
|
||||
<select id="findActiveByIdAndCompanyId" resultMap="AnnotationResultResultMap">
|
||||
select <include refid="AnnotationResultColumns"/>
|
||||
from annotation_result
|
||||
where id = #{id}
|
||||
and company_id = #{companyId}
|
||||
and is_deleted = false
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="markArchived">
|
||||
update annotation_result
|
||||
set is_deleted = true,
|
||||
reviewer_id = #{reviewerId},
|
||||
review_comment = #{reviewComment},
|
||||
reviewed_at = #{reviewedAt},
|
||||
updated_at = #{reviewedAt}
|
||||
where id = #{id}
|
||||
and company_id = #{companyId}
|
||||
and is_deleted = false
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user