feat:生成评测docx
This commit is contained in:
156
enlish-service/src/main/resources/mapper/AssessmentsDOMapper.xml
Normal file
156
enlish-service/src/main/resources/mapper/AssessmentsDOMapper.xml
Normal file
@@ -0,0 +1,156 @@
|
||||
<?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.AssessmentsDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="student_id" jdbcType="INTEGER" property="studentId" />
|
||||
<result column="test_date" jdbcType="TIMESTAMP" property="testDate" />
|
||||
<result column="test_type" jdbcType="INTEGER" property="testType" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="estimated_vocab_size" jdbcType="INTEGER" property="estimatedVocabSize" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
<result column="content_details_json" jdbcType="LONGVARCHAR" property="contentDetailsJson" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, student_id, test_date, test_type, level, estimated_vocab_size
|
||||
</sql>
|
||||
|
||||
<sql id="Blob_Column_List">
|
||||
content_details_json
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from assessments
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from assessments
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
insert into assessments (id, student_id, test_date,
|
||||
test_type, level, estimated_vocab_size,
|
||||
content_details_json)
|
||||
values (#{id,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER}, #{testDate,jdbcType=TIMESTAMP},
|
||||
#{testType,jdbcType=INTEGER}, #{level,jdbcType=INTEGER}, #{estimatedVocabSize,jdbcType=INTEGER},
|
||||
#{contentDetailsJson,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
insert into assessments
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id,
|
||||
</if>
|
||||
<if test="testDate != null">
|
||||
test_date,
|
||||
</if>
|
||||
<if test="testType != null">
|
||||
test_type,
|
||||
</if>
|
||||
<if test="level != null">
|
||||
level,
|
||||
</if>
|
||||
<if test="estimatedVocabSize != null">
|
||||
estimated_vocab_size,
|
||||
</if>
|
||||
<if test="contentDetailsJson != null">
|
||||
content_details_json,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
#{studentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="testDate != null">
|
||||
#{testDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="testType != null">
|
||||
#{testType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
#{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="estimatedVocabSize != null">
|
||||
#{estimatedVocabSize,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="contentDetailsJson != null">
|
||||
#{contentDetailsJson,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
update assessments
|
||||
<set>
|
||||
<if test="studentId != null">
|
||||
student_id = #{studentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="testDate != null">
|
||||
test_date = #{testDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="testType != null">
|
||||
test_type = #{testType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="estimatedVocabSize != null">
|
||||
estimated_vocab_size = #{estimatedVocabSize,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="contentDetailsJson != null">
|
||||
content_details_json = #{contentDetailsJson,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
update assessments
|
||||
set student_id = #{studentId,jdbcType=INTEGER},
|
||||
test_date = #{testDate,jdbcType=TIMESTAMP},
|
||||
test_type = #{testType,jdbcType=INTEGER},
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
estimated_vocab_size = #{estimatedVocabSize,jdbcType=INTEGER},
|
||||
content_details_json = #{contentDetailsJson,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.yinlihupo.enlish.service.domain.dataobject.AssessmentsDO">
|
||||
update assessments
|
||||
set student_id = #{studentId,jdbcType=INTEGER},
|
||||
test_date = #{testDate,jdbcType=TIMESTAMP},
|
||||
test_type = #{testType,jdbcType=INTEGER},
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
estimated_vocab_size = #{estimatedVocabSize,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectAssessmentsIdByStudentIdAndTestType">
|
||||
select id
|
||||
from assessments
|
||||
where student_id = #{studentId,jdbcType=INTEGER}
|
||||
and test_type = #{testType,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="selectContentDetailsJsonByAssessmentsId">
|
||||
select content_details_json
|
||||
from assessments
|
||||
where id = #{assessmentsId,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -97,4 +97,11 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectVocabularyBankDOListByUnitId" resultMap="BaseResultMap">
|
||||
select *
|
||||
from vocabulary_bank
|
||||
where unit_id = #{unitId}
|
||||
limit #{wordCount}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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.WordMasteryLogDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.WordMasteryLogDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="student_id" jdbcType="INTEGER" property="studentId" />
|
||||
<result column="word_id" jdbcType="INTEGER" property="wordId" />
|
||||
<result column="review_count" jdbcType="INTEGER" property="reviewCount" />
|
||||
<result column="memory_strength" jdbcType="DECIMAL" property="memoryStrength" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, student_id, word_id, review_count, memory_strength
|
||||
</sql>
|
||||
|
||||
<select id="selectByStudentIdAndUnitIdOrderByMemoryStrength" resultMap="BaseResultMap">
|
||||
select *
|
||||
from word_mastery_log
|
||||
where student_id = #{studentId}
|
||||
and word_id in (
|
||||
select id
|
||||
from vocabulary_bank
|
||||
where unit_id = #{unitId}
|
||||
)
|
||||
order by memory_strength desc
|
||||
limit #{limit}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user