2025-04-23 17:21:25 +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="pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper">
|
|
|
|
|
|
|
|
<resultMap type="EducationPaper" id="EducationPaperResult">
|
|
|
|
<result property="paperId" column="paper_id" />
|
|
|
|
<result property="taskId" column="task_id" />
|
2025-05-05 00:01:11 +08:00
|
|
|
<result property="num" column="num" />
|
2025-04-23 17:21:25 +08:00
|
|
|
<result property="counts" column="counts" />
|
2025-05-12 09:24:27 +08:00
|
|
|
<result property="paperScore" column="paper_score" />
|
2025-04-23 17:21:25 +08:00
|
|
|
<result property="rollUp" column="roll_up" />
|
|
|
|
<result property="isAb" column="is_ab" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="creator" column="creator" />
|
|
|
|
<result property="updater" column="updater" />
|
|
|
|
<result property="deleted" column="deleted" />
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
</resultMap>
|
|
|
|
|
2025-05-26 20:13:16 +08:00
|
|
|
<resultMap type="EducationPaper" id="PaperIdAndNumResult">
|
|
|
|
<result property="paperId" column="paper_id" />
|
|
|
|
<result property="num" column="num" />
|
|
|
|
|
|
|
|
</resultMap>
|
2025-04-23 17:21:25 +08:00
|
|
|
|
|
|
|
<resultMap type="ExamQuestion" id="ExamQuestionResult">
|
|
|
|
<result property="quId" column="qu_id" />
|
|
|
|
<result property="quBankId" column="qu_bank_id" />
|
|
|
|
<result property="quBankName" column="qu_bank_name" />
|
|
|
|
<result property="chapteridDictText" column="chapterId_dict_text" />
|
|
|
|
<result property="subjectName" column="subject_name" />
|
|
|
|
<result property="quLevel" column="qu_level" />
|
|
|
|
<result property="content" column="content" />
|
|
|
|
<result property="contentText" column="content_text" />
|
|
|
|
<result property="analysis" column="analysis" />
|
|
|
|
<result property="pointNames" column="point_names" />
|
|
|
|
<result property="keywords" column="keywords" />
|
|
|
|
<result property="manual" column="manual" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="creator" column="creator" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="updater" column="updater" />
|
|
|
|
<result property="deleted" column="deleted" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<result property="audit" column="audit" />
|
|
|
|
<result property="courseName" column="course_name" />
|
|
|
|
<result property="specialtyName" column="specialty_name" />
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectEducationPaperVo">
|
2025-05-12 09:24:27 +08:00
|
|
|
select paper_id, task_id, num,counts, paper_score,roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
|
2025-04-23 17:21:25 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEducationPaperByPaperId" parameterType="String" resultMap="EducationPaperResult">
|
|
|
|
<include refid="selectEducationPaperVo"/>
|
|
|
|
where paper_id = #{paperId}
|
|
|
|
</select>
|
|
|
|
<select id="selectQuByPaperScheme" resultType="java.lang.String">
|
|
|
|
|
|
|
|
SELECT qu_id
|
|
|
|
FROM exam_question
|
|
|
|
WHERE
|
|
|
|
specialty_name = #{taskSpecialty}
|
|
|
|
AND subject_name = #{educationPaperScheme.spName}
|
|
|
|
AND tenant_id =#{tId}
|
|
|
|
and audit = 0
|
|
|
|
and status = 0
|
2025-04-25 15:51:06 +08:00
|
|
|
and deleted ='0'
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="educationPaperScheme.quLevel != null and educationPaperScheme.quLevel != ''">
|
|
|
|
AND qu_level = #{educationPaperScheme.quLevel}
|
|
|
|
</if>
|
|
|
|
<if test="keywordList != null and keywordList.size() > 0">
|
|
|
|
AND (
|
|
|
|
<foreach collection="keywordList" item="kw" separator=" OR ">
|
|
|
|
keywords LIKE CONCAT('%', #{kw}, '%')
|
|
|
|
</foreach>
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="pointName != null and pointName.size() > 0">
|
|
|
|
AND (
|
|
|
|
<foreach collection="pointName" item="pt" separator=" OR ">
|
|
|
|
point_names LIKE CONCAT('%', #{pt}, '%')
|
|
|
|
</foreach>
|
|
|
|
)
|
|
|
|
</if>
|
|
|
|
ORDER BY RAND()
|
|
|
|
LIMIT #{educationPaperScheme.quNumbers}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectTaskIdByPaperId" resultType="java.lang.String">
|
|
|
|
select task_id from education_paper where paper_id=#{paperId}
|
|
|
|
</select>
|
|
|
|
<select id="selectPaperByTaskId" resultType="java.lang.String">
|
2025-04-25 15:51:06 +08:00
|
|
|
select paper_id from education_paper where task_id=#{taskId} and deleted ='0'
|
2025-04-23 17:21:25 +08:00
|
|
|
</select>
|
|
|
|
<select id="selectPaperRandomByTaskId" resultType="java.lang.String">
|
|
|
|
select paper_id from education_paper where task_id=#{taskId} and roll_up ='2'
|
|
|
|
|
|
|
|
</select>
|
|
|
|
<select id="selectPaperByTaskIdAndRoll" resultType="java.lang.String">
|
2025-04-25 15:51:06 +08:00
|
|
|
select paper_id from education_paper where task_id=#{taskId} and deleted ='0'
|
2025-04-23 17:21:25 +08:00
|
|
|
</select>
|
2025-05-05 00:01:11 +08:00
|
|
|
<select id="getPaperByTaskIdByType" resultMap="EducationPaperResult">
|
|
|
|
select * from education_paper where task_id=#{taskId} and status ='0' and deleted ='0' and roll_up IS NOT NULL
|
2025-04-23 17:21:25 +08:00
|
|
|
|
|
|
|
</select>
|
|
|
|
<select id="getSelectPaperIdBySchemeIds" resultType="java.lang.String">
|
|
|
|
select paper_id from education_paper_session where session_id =#{row}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
<select id="selectPaperListByTaskId" resultMap="EducationPaperResult">
|
|
|
|
<include refid="selectEducationPaperVo"/>
|
2025-04-25 15:51:06 +08:00
|
|
|
where task_id =#{taskId} and deleted ='0'
|
2025-04-23 17:21:25 +08:00
|
|
|
</select>
|
2025-05-05 00:01:11 +08:00
|
|
|
<select id="selectCountPaperList" resultType="java.lang.Integer">
|
|
|
|
select count(*) from education_paper
|
|
|
|
</select>
|
2025-05-26 20:13:16 +08:00
|
|
|
<select id="selectPaperIdAndNumByTaskId" resultMap="PaperIdAndNumResult">
|
|
|
|
select paper_id ,num from education_paper where task_id=#{taskId} and deleted ='0'
|
|
|
|
</select>
|
2025-04-23 17:21:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertEducationPaper" parameterType="EducationPaper">
|
|
|
|
insert into education_paper
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="paperId != null">paper_id,</if>
|
|
|
|
<if test="taskId != null">task_id,</if>
|
2025-05-05 00:01:11 +08:00
|
|
|
<if test="num != null">num,</if>
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="counts != null">counts,</if>
|
2025-05-12 09:24:27 +08:00
|
|
|
<if test="paperScore != null">paper_score,</if>
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="rollUp != null">roll_up,</if>
|
|
|
|
<if test="isAb != null">is_ab,</if>
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="creator != null">creator,</if>
|
|
|
|
<if test="updater != null">updater,</if>
|
|
|
|
<if test="deleted != null">deleted,</if>
|
|
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="paperId != null">#{paperId},</if>
|
|
|
|
<if test="taskId != null">#{taskId},</if>
|
2025-05-05 00:01:11 +08:00
|
|
|
<if test="num != null">#{num},</if>
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="counts != null">#{counts},</if>
|
2025-05-12 09:24:27 +08:00
|
|
|
<if test="paperScore != null">#{paperScore},</if>
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="rollUp != null">#{rollUp},</if>
|
|
|
|
<if test="isAb != null">#{isAb},</if>
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="creator != null">#{creator},</if>
|
|
|
|
<if test="updater != null">#{updater},</if>
|
|
|
|
<if test="deleted != null">#{deleted},</if>
|
|
|
|
<if test="tenantId != null">#{tenantId},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
<insert id="insertEducationPaperList">
|
2025-05-12 09:24:27 +08:00
|
|
|
INSERT INTO education_paper (paper_id, task_id,num ,counts,paper_score, roll_up, is_ab, status ) VALUES
|
2025-04-23 17:21:25 +08:00
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
(
|
2025-05-12 09:24:27 +08:00
|
|
|
#{item.paperId}, #{item.taskId}, #{item.num},#{item.counts},#{item.paperScore}, #{item.rollUp}, #{item.isAb}, #{item.status}
|
2025-04-23 17:21:25 +08:00
|
|
|
)
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateEducationPaper" parameterType="EducationPaper">
|
|
|
|
update education_paper
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="taskId != null">task_id = #{taskId},</if>
|
|
|
|
<if test="counts != null">counts = #{counts},</if>
|
2025-05-12 09:24:27 +08:00
|
|
|
<if test="paperScore != null">paper_score = #{paperScore},</if>
|
2025-04-23 17:21:25 +08:00
|
|
|
<if test="rollUp != null">roll_up = #{rollUp},</if>
|
|
|
|
<if test="isAb != null">is_ab = #{isAb},</if>
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
<if test="creator != null">creator = #{creator},</if>
|
|
|
|
<if test="updater != null">updater = #{updater},</if>
|
|
|
|
<if test="deleted != null">deleted = #{deleted},</if>
|
|
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
|
</trim>
|
|
|
|
where paper_id = #{paperId}
|
|
|
|
</update>
|
|
|
|
<update id="updateEducationByids">
|
|
|
|
|
|
|
|
UPDATE education_paper
|
|
|
|
SET roll_up = '2', is_ab = null
|
|
|
|
WHERE paper_id IN
|
|
|
|
<foreach collection="strings" item="paperId" open="(" separator="," close=")">
|
|
|
|
#{paperId}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
<update id="updateRandomByids">
|
|
|
|
UPDATE education_paper
|
|
|
|
SET roll_up = null, is_ab = null
|
|
|
|
WHERE paper_id IN
|
|
|
|
<foreach collection="strings" item="paperId" open="(" separator="," close=")">
|
|
|
|
#{paperId}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
<update id="updatePaperGuByRollup">
|
|
|
|
UPDATE education_paper
|
|
|
|
SET roll_up = null, is_ab = null
|
|
|
|
where task_id=#{taskId} and roll_up ='1'
|
|
|
|
</update>
|
|
|
|
<update id="updateEducationByidsThree">
|
|
|
|
UPDATE education_paper
|
|
|
|
SET roll_up = '3', is_ab = null
|
|
|
|
WHERE paper_id IN
|
|
|
|
<foreach collection="strings" item="paperId" open="(" separator="," close=")">
|
|
|
|
#{paperId}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
<update id="changeStatus">
|
|
|
|
UPDATE education_paper
|
|
|
|
SET status = #{status}
|
|
|
|
where paper_id =#{paperId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEducationPaperByPaperId" parameterType="String">
|
|
|
|
delete from education_paper where paper_id = #{paperId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteEducationPaperByPaperIds" parameterType="String">
|
|
|
|
UPDATE education_paper SET deleted = '2'
|
|
|
|
WHERE paper_id IN
|
|
|
|
<foreach item="taskId" collection="paperIds" open="(" separator="," close=")">
|
|
|
|
#{taskId}
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|