- 支持数据库多语句查询,修改数据源连接配置增加allowMultiQueries参数 - 添加定时任务AutoJudgeExamWordsTask,实现每5秒自动触发判卷 - 增加ExamWordsJudge接口及其实现类ExamWordsJudgeImpl,完成考试判卷逻辑 - 新增多张数据库映射文件及对应Mapper,如ExamWordsDOMapper、ExamWordsJudgeResultDOMapper、StudentExamWordsDOMapper和WordMasteryLogDOMapper,支持相关数据操作 - 扩展PngUtil工具类,支持从答题卡图片中解析学生考试信息和识别未记忆单词 - 修改数据库表结构映射,新增word_mastery_log表和相关字段,管理学生单词记忆强度及复习次数 - 配置@EnableScheduling以启用定时任务调度功能 - 增加测试用例包括ExamWordsJudgeTest和WordMasteryLogInsertTest,验证判卷和学生单词记忆初始化功能 - 重命名测试类TestInsert为TestVocabularyBankInsert,提升代码语义清晰度
37 lines
1.5 KiB
XML
37 lines
1.5 KiB
XML
<?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.yinlihupo.enlish.service.domain.mapper.StudentExamWordsDOMapper">
|
|
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.StudentExamWordsDO">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="student_id" jdbcType="INTEGER" property="studentId" />
|
|
<result column="exam_words_id" jdbcType="INTEGER" property="examWordsId" />
|
|
<result column="is_completed" jdbcType="INTEGER" property="isCompleted" />
|
|
<result column="start_data" jdbcType="TIMESTAMP" property="startData" />
|
|
</resultMap>
|
|
|
|
<insert id="insertStudentsExam">
|
|
insert into student_exam_words
|
|
(student_id, exam_words_id, is_completed, start_data)
|
|
values
|
|
<foreach collection="studentIds" item="studentId" separator=",">
|
|
(#{studentId}, #{examWordsId}, 0, now())
|
|
</foreach>
|
|
</insert>
|
|
|
|
<select id="selectByStudentIdAndExamWordsId" resultMap="BaseResultMap">
|
|
select *
|
|
from student_exam_words
|
|
where student_id = #{studentId}
|
|
and exam_words_id = #{examWordsId}
|
|
and is_completed = 0
|
|
</select>
|
|
|
|
<update id="updateStudentExamWordsFinished">
|
|
update student_exam_words
|
|
set is_completed = 1
|
|
where student_id = #{studentId}
|
|
and exam_words_id = #{examWordsId}
|
|
and is_completed = 0
|
|
</update>
|
|
|
|
</mapper> |