【修改】试卷任务,【新增】试题交互,定时试题交互

This commit is contained in:
YOHO\20373
2025-05-16 15:32:38 +08:00
parent 247f6e4b19
commit 86188a7a54
61 changed files with 1612 additions and 103 deletions

View File

@@ -15,6 +15,11 @@
<result property="usb" column="usb" />
<result property="saveGrades" column="save_grades" />
<result property="driver" column="driver" />
<result property="isTime" column="is_time" />
<result property="examTime" column="exam_time" />
<result property="directory" column="directory" />
<result property="uploadTime" column="upload_time" />
<result property="isDel" column="is_del" />
@@ -26,7 +31,7 @@
</resultMap>
<sql id="selectEducationPaperParamVo">
select param_id, task_id, is_number,is_content,is_answer_id,is_exam_password, exam_password, usb, save_grades, driver, directory, upload_time, is_del,is_repeat ,is_answer,is_look,is_connect,is_session from education_paper_param
select param_id, task_id, is_number,is_content,is_answer_id,is_exam_password, exam_password, usb, save_grades, driver, directory, upload_time, is_time,exam_time,is_del,is_repeat ,is_answer,is_look,is_connect,is_session from education_paper_param
</sql>
<select id="selectEducationPaperParamList" parameterType="EducationPaperParam" resultMap="EducationPaperParamResult">
@@ -68,6 +73,8 @@
<if test="driver != null">driver,</if>
<if test="directory != null">directory,</if>
<if test="uploadTime != null">upload_time,</if>
<if test="isTime != null">is_time,</if>
<if test="examTime != null">exam_time,</if>
<if test="isDel != null">is_del,</if>
<if test="isRepeat != null">is_repeat,</if>
<if test="isAnswer != null">is_answer,</if>
@@ -89,6 +96,9 @@
<if test="driver != null">#{driver},</if>
<if test="directory != null">#{directory},</if>
<if test="uploadTime != null">#{uploadTime},</if>
<if test="isTime != null">#{isTime},</if>
<if test="examTime != null">#{examTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="isRepeat != null">#{isRepeat},</if>
<if test="isAnswer != null">#{isAnswer},</if>
@@ -113,6 +123,8 @@
<if test="driver != null">driver = #{driver},</if>
<if test="directory != null">directory = #{directory},</if>
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="isTime != null">is_time = #{isTime},</if>
<if test="examTime != null">exam_time = #{examTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="isRepeat != null">is_repeat = #{isRepeat},</if>
<if test="isAnswer != null">is_answer = #{isAnswer},</if>

View File

@@ -25,21 +25,17 @@
</where>
</select>
<select id="selectEducationPaperPersonByTaskId" parameterType="String" resultMap="EducationPaperPersonResult">
<include refid="selectEducationPaperPersonVo"/>
where task_id = #{taskId}
</select>
<select id="selectUserById" resultType="pc.exam.pp.module.exam.controller.admin.paper.dto.PersonRepDto">
select * from system_users where id =#{personId}
</select>
<select id="selectUserClassName" resultType="java.lang.String">
select name from exam_class where id =#{classId}
</select>
<select id="selectEducationPaperPersonBySessionId" parameterType="String" resultMap="EducationPaperPersonResult">
<include refid="selectEducationPaperPersonVo"/>
where session_id = #{sessionId}
</select>
<select id="selectEducationPaperPersonByNotInSessionId"
resultType="pc.exam.pp.module.exam.controller.admin.paper.dto.PersonRepDto">
SELECT DISTINCT s.*
@@ -67,7 +63,7 @@
AND s.class_id = #{classId}
</if>
ORDER BY s.id DESC
LIMIT #{pageSize} OFFSET #{offset}
</select>
@@ -111,6 +107,81 @@
select person_id from education_paper_person where task_id=#{taskId}
</select>
<select id="selectTaskIdByStuid" resultType="java.lang.String">
select task_id from education_paper_person where person_id =#{loginUserId}
</select>
<select id="selectEducationPaperPersonBySessionId"
resultMap="EducationPaperPersonResult">
<include refid="selectEducationPaperPersonVo"/>
where session_id = #{sessionId}
LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="selectEducationPaperPersonByTaskIdTotal" resultType="java.lang.Long">
select count(*) from education_paper_person where task_id = #{taskId}
</select>
<select id="selectEducationPaperPersonBySessionIdTotal" resultType="java.lang.Long">
select count(*) from education_paper_person
where session_id = #{sessionId}
</select>
<select id="selectEducationPaperPersonByTaskId"
resultMap="EducationPaperPersonResult">
<include refid="selectEducationPaperPersonVo"/>
where task_id = #{taskId}
LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="selectEducationPaperPersonByNotInSessionIdTotal" resultType="java.lang.Long">
SELECT COUNT(DISTINCT s.id)
FROM system_users s
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
WHERE
s.user_type = #{userType}
AND s.id IN (
SELECT person_id FROM education_paper_person WHERE
session_id ='' and
session_id !=#{sessionId} and task_id =#{taskId}
)
<if test="username != null and username != ''">
AND s.username LIKE CONCAT('%', #{username}, '%')
</if>
<if test="status != null">
AND s.status = #{status}
</if>
<if test="startTime != null and endTime != null">
AND s.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="classId != null and classId != ''">
AND s.class_id = #{classId}
</if>
</select>
<select id="selectEducationPaperPersonBySessionIdNotInTotal" resultType="java.lang.Long">
SELECT COUNT(DISTINCT s.id)
FROM system_users s
LEFT JOIN education_paper_person pp ON s.id = pp.person_id
WHERE
s.user_type = #{userType}
AND s.id NOT IN (
SELECT person_id FROM education_paper_person WHERE task_id =#{taskId}
)
<if test="username != null and username != ''">
AND s.username LIKE CONCAT('%', #{username}, '%')
</if>
<if test="status != null">
AND s.status = #{status}
</if>
<if test="startTime != null and endTime != null">
AND s.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="classId != null and classId != ''">
AND s.class_id = #{classId}
</if>
</select>
<insert id="insertEducationPaperPerson" parameterType="EducationPaperPerson">

View File

@@ -32,6 +32,10 @@
<include refid="selectEducationPaperSessionVo"/>
where task_id =#{taskId}
</select>
<select id="getAnswerTime" resultType="java.sql.Time">
select exam_time from education_paper_param where task_id =#{taskId}
</select>
<insert id="insertEducationPaperSession" parameterType="EducationPaperSession">
insert into education_paper_session

View File

@@ -41,7 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sort" column="sort"/>
</collection>
</resultMap>
<resultMap type="pc.exam.pp.module.exam.controller.admin.question.vo.TenantVo" id="TenantVoResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="ququeName" column="queue_name" />
</resultMap>
<sql id="selectExamQuestionVo">
select qu_id, qu_bank_id, qu_bank_name, chapterId_dict_text,subject_name, qu_level,
content, content_text, analysis, point_names, keywords, manual, create_time, creator, update_time, updater, deleted ,status,audit ,course_name, specialty_name from exam_question
@@ -75,6 +79,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
CASE WHEN a.sort IS NOT NULL THEN 0 ELSE 1 END,
a.sort ASC
</select>
<select id="getSchoolName" resultMap="TenantVoResult">
SELECT id, name, queue_name
FROM system_tenant
WHERE deleted = 0
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>
LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="getSchoolNameTotal" resultType="java.lang.Long">
SELECT count(*)
FROM system_tenant
WHERE id != 1 AND deleted = 0
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>
</select>
<select id="selectExamQuestionByQuIdAndTenantId"
resultMap="ExamQuestionResult">
<include refid="selectExamQuestionVo"/>
where qu_id = #{quId} and tenant_id= #{source}
</select>
<select id="seleAllQueueName" resultType="java.lang.String">
SELECT queue_name
FROM system_tenant
WHERE deleted = 0
</select>
<insert id="insertExamQuestion" parameterType="ExamQuestion">
@@ -170,6 +202,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</update>
<update id="setQuestionAuditByids">
UPDATE exam_question
SET audit = '2'
WHERE qu_id IN
<foreach collection="quIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="auditQueByIds">
UPDATE exam_question
SET audit = '0'
WHERE qu_id IN
<foreach collection="quIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="noAuditQue">
UPDATE exam_question
SET audit = '3'
WHERE qu_id IN
<foreach collection="quIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,27 @@
<?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.questionexamine.QuestionExamineMapper">
<insert id="insertOrUpdateList">
INSERT INTO education_question_examine (qu_id,source, create_teacher,type,create_time)
VALUES
<foreach collection="collection" item="item" separator=",">
( #{item.quId}, #{item.source}, #{item.createTeacher}, #{item.type},now())
</foreach>
ON DUPLICATE KEY UPDATE
source = VALUES(source),
create_teacher = VALUES(create_teacher),
type = VALUES(type),
create_time=now()
</insert>
<select id="selectSchoolName" resultType="java.lang.String">
select name from system_tenant where id =#{source}
</select>
</mapper>