【新增】移植试题,试卷任务后端
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
<?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" />
|
||||
<result property="counts" column="counts" />
|
||||
<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>
|
||||
|
||||
|
||||
<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">
|
||||
select paper_id, task_id, counts, roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
|
||||
</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
|
||||
<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">
|
||||
select paper_id from education_paper where task_id=#{taskId}
|
||||
</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">
|
||||
select paper_id from education_paper where task_id=#{taskId}
|
||||
</select>
|
||||
<select id="getPaperByTaskIdByType" resultType="java.lang.String">
|
||||
select paper_id from education_paper where task_id=#{taskId} and status ='0' and roll_up IS NOT NULL
|
||||
|
||||
</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"/>
|
||||
where task_id =#{taskId}
|
||||
</select>
|
||||
|
||||
|
||||
<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>
|
||||
<if test="counts != null">counts,</if>
|
||||
<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>
|
||||
<if test="counts != null">#{counts},</if>
|
||||
<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">
|
||||
INSERT INTO education_paper (paper_id, task_id, counts, roll_up, is_ab, status ) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.paperId}, #{item.taskId}, #{item.counts}, #{item.rollUp}, #{item.isAb}, #{item.status}
|
||||
)
|
||||
</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>
|
||||
<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>
|
@@ -0,0 +1,123 @@
|
||||
<?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.EducationPaperParamMapper">
|
||||
|
||||
<resultMap type="EducationPaperParam" id="EducationPaperParamResult">
|
||||
<result property="paramId" column="param_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="isExamPassword" column="is_exam_password" />
|
||||
<result property="examPassword" column="exam_password" />
|
||||
<result property="usb" column="usb" />
|
||||
<result property="saveGrades" column="save_grades" />
|
||||
<result property="driver" column="driver" />
|
||||
<result property="directory" column="directory" />
|
||||
<result property="uploadTime" column="upload_time" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="isRepeat" column="is_repeat" />
|
||||
<result property="isAnswer" column="is_answer" />
|
||||
<result property="isLook" column="is_look" />
|
||||
<result property="isConnect" column="is_connect" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperParamVo">
|
||||
select param_id, task_id, is_exam_password, exam_password, usb, save_grades, driver, directory, upload_time, is_del,is_repeat ,is_answer,is_look,is_connect from education_paper_param
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperParamList" parameterType="EducationPaperParam" resultMap="EducationPaperParamResult">
|
||||
<include refid="selectEducationPaperParamVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="isExamPassword != null and isExamPassword != ''"> and is_exam_password = #{isExamPassword}</if>
|
||||
<if test="examPassword != null and examPassword != ''"> and exam_password = #{examPassword}</if>
|
||||
<if test="usb != null and usb != ''"> and usb = #{usb}</if>
|
||||
<if test="saveGrades != null and saveGrades != ''"> and save_grades = #{saveGrades}</if>
|
||||
<if test="driver != null and driver != ''"> and driver = #{driver}</if>
|
||||
<if test="directory != null and directory != ''"> and directory = #{directory}</if>
|
||||
<if test="uploadTime != null and uploadTime != ''"> and upload_time = #{uploadTime}</if>
|
||||
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperParamByParamId" parameterType="String" resultMap="EducationPaperParamResult">
|
||||
<include refid="selectEducationPaperParamVo"/>
|
||||
where param_id = #{paramId}
|
||||
</select>
|
||||
<select id="selectEducationPaperParamByTaskId" resultMap="EducationPaperParamResult">
|
||||
<include refid="selectEducationPaperParamVo"/>
|
||||
where task_id =#{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEducationPaperParam" parameterType="EducationPaperParam">
|
||||
insert into education_paper_param
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="paramId != null">param_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="isExamPassword != null">is_exam_password,</if>
|
||||
<if test="examPassword != null">exam_password,</if>
|
||||
<if test="usb != null">usb,</if>
|
||||
<if test="saveGrades != null">save_grades,</if>
|
||||
<if test="driver != null">driver,</if>
|
||||
<if test="directory != null">directory,</if>
|
||||
<if test="uploadTime != null">upload_time,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="isRepeat != null">is_repeat,</if>
|
||||
<if test="isAnswer != null">is_answer,</if>
|
||||
<if test="isLook != null">is_look,</if>
|
||||
<if test="isConnect != null">is_connect,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="paramId != null">#{paramId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="isExamPassword != null">#{isExamPassword},</if>
|
||||
<if test="examPassword != null">#{examPassword},</if>
|
||||
<if test="usb != null">#{usb},</if>
|
||||
<if test="saveGrades != null">#{saveGrades},</if>
|
||||
<if test="driver != null">#{driver},</if>
|
||||
<if test="directory != null">#{directory},</if>
|
||||
<if test="uploadTime != null">#{uploadTime},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="isRepeat != null">#{isRepeat},</if>
|
||||
<if test="isAnswer != null">#{isAnswer},</if>
|
||||
<if test="isLook != null">#{isLook},</if>
|
||||
<if test="isConnect != null">#{isConnect},</if>
|
||||
|
||||
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEducationPaperParam" parameterType="EducationPaperParam">
|
||||
update education_paper_param
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="isExamPassword != null">is_exam_password = #{isExamPassword},</if>
|
||||
<if test="examPassword != null">exam_password = #{examPassword},</if>
|
||||
<if test="usb != null">usb = #{usb},</if>
|
||||
<if test="saveGrades != null">save_grades = #{saveGrades},</if>
|
||||
<if test="driver != null">driver = #{driver},</if>
|
||||
<if test="directory != null">directory = #{directory},</if>
|
||||
<if test="uploadTime != null">upload_time = #{uploadTime},</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>
|
||||
<if test="isLook != null">is_look = #{isLook},</if>
|
||||
<if test="isConnect != null">is_connect = #{isConnect},</if>
|
||||
|
||||
|
||||
</trim>
|
||||
where param_id = #{paramId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperParamByParamId" parameterType="String">
|
||||
delete from education_paper_param where param_id = #{paramId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperParamByParamIds" parameterType="String">
|
||||
delete from education_paper_param where param_id in
|
||||
<foreach item="paramId" collection="array" open="(" separator="," close=")">
|
||||
#{paramId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,64 @@
|
||||
<?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.EducationPaperPersonMapper">
|
||||
|
||||
<resultMap type="EducationPaperPerson" id="EducationPaperPersonResult">
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="personId" column="person_id" />
|
||||
<result property="sessionId" column="session_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperPersonVo">
|
||||
select task_id, person_id, session_id from education_paper_person
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperPersonList" parameterType="EducationPaperPerson" resultMap="EducationPaperPersonResult">
|
||||
<include refid="selectEducationPaperPersonVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="personId != null and personId != ''"> and person_id = #{personId}</if>
|
||||
<if test="sessionId != null and sessionId != ''"> and session_id = #{sessionId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperPersonByTaskId" parameterType="String" resultMap="EducationPaperPersonResult">
|
||||
<include refid="selectEducationPaperPersonVo"/>
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEducationPaperPerson" parameterType="EducationPaperPerson">
|
||||
insert into education_paper_person
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="personId != null">person_id,</if>
|
||||
<if test="sessionId != null">session_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="personId != null">#{personId},</if>
|
||||
<if test="sessionId != null">#{sessionId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEducationPaperPerson" parameterType="EducationPaperPerson">
|
||||
update education_paper_person
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="personId != null">person_id = #{personId},</if>
|
||||
<if test="sessionId != null">session_id = #{sessionId},</if>
|
||||
</trim>
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperPersonByTaskId" parameterType="String">
|
||||
delete from education_paper_person where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperPersonByTaskIds" parameterType="String">
|
||||
delete from education_paper_person where task_id in
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,80 @@
|
||||
<?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.EducationPaperQuMapper">
|
||||
|
||||
<resultMap type="EducationPaperQu" id="EducationPaperQuResult">
|
||||
<result property="paperId" column="paper_id" />
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="quVersion" column="qu_version" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperQuVo">
|
||||
select paper_id, qu_id, qu_version from education_paper_qu
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperQuList" parameterType="EducationPaperQu" resultMap="EducationPaperQuResult">
|
||||
<include refid="selectEducationPaperQuVo"/>
|
||||
<where>
|
||||
<if test="paperId != null and paperId != ''"> and paper_id = #{paperId}</if>
|
||||
<if test="quId != null and quId != ''"> and qu_id = #{quId}</if>
|
||||
<if test="quVersion != null and quVersion != ''"> and qu_version = #{quVersion}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperQuByPaperId" parameterType="String" resultMap="EducationPaperQuResult">
|
||||
<include refid="selectEducationPaperQuVo"/>
|
||||
where paper_id = #{paperId}
|
||||
</select>
|
||||
<select id="selectPaperQuByPaperId" resultType="java.lang.String">
|
||||
select qu_id from education_paper_qu where paper_id =#{paperId}
|
||||
</select>
|
||||
<select id="selectPaperQuListByPaperId" resultMap="EducationPaperQuResult">
|
||||
<include refid="selectEducationPaperQuVo"/>
|
||||
where paper_id = #{paperId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEducationPaperQu" parameterType="EducationPaperQu">
|
||||
insert into education_paper_qu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="paperId != null">paper_id,</if>
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="quVersion != null">qu_version,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="paperId != null">#{paperId},</if>
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="quVersion != null">#{quVersion},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperQuList">
|
||||
INSERT INTO education_paper_qu (paper_id ,qu_id )VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.paperId}, #{item.quId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateEducationPaperQu" parameterType="EducationPaperQu">
|
||||
update education_paper_qu
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id = #{quId},</if>
|
||||
<if test="quVersion != null">qu_version = #{quVersion},</if>
|
||||
</trim>
|
||||
where paper_id = #{paperId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperQuByPaperId" parameterType="String">
|
||||
delete from education_paper_qu where paper_id = #{paperId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperQuByPaperIds" parameterType="String">
|
||||
delete from education_paper_qu where paper_id in
|
||||
<foreach item="paperId" collection="array" open="(" separator="," close=")">
|
||||
#{paperId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,104 @@
|
||||
<?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.EducationPaperSchemeMapper">
|
||||
|
||||
<resultMap type="EducationPaperScheme" id="EducationPaperSchemeResult">
|
||||
<result property="schemeId" column="scheme_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="spName" column="sp_name" />
|
||||
<result property="quLevel" column="qu_level" />
|
||||
<result property="keywords" column="keywords" />
|
||||
<result property="pointNames" column="point_names" />
|
||||
<result property="quNumbers" column="qu_numbers" />
|
||||
<result property="quScores" column="qu_scores" />
|
||||
<result property="subtotalScore" column="subtotal_score" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperSchemeVo">
|
||||
select scheme_id, task_id, sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score from education_paper_scheme
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperSchemeList" parameterType="EducationPaperScheme" resultMap="EducationPaperSchemeResult">
|
||||
<include refid="selectEducationPaperSchemeVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="spName != null and spName != ''"> and sp_name like concat('%', #{spName}, '%')</if>
|
||||
<if test="quLevel != null and quLevel != ''"> and qu_level = #{quLevel}</if>
|
||||
<if test="keywords != null and keywords != ''"> and keywords = #{keywords}</if>
|
||||
<if test="pointNames != null and pointNames != ''"> and point_names = #{pointNames}</if>
|
||||
<if test="quNumbers != null and quNumbers != ''"> and qu_numbers = #{quNumbers}</if>
|
||||
<if test="quScores != null and quScores != ''"> and qu_scores = #{quScores}</if>
|
||||
<if test="subtotalScore != null and subtotalScore != ''"> and subtotal_score = #{subtotalScore}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperSchemeBySchemeId" parameterType="String" resultMap="EducationPaperSchemeResult">
|
||||
<include refid="selectEducationPaperSchemeVo"/>
|
||||
where scheme_id = #{schemeId}
|
||||
</select>
|
||||
<select id="selectEducationPaperTaskByTaskId" resultMap="EducationPaperSchemeResult">
|
||||
select * from education_paper_scheme where task_id =#{taskid}
|
||||
</select>
|
||||
|
||||
<insert id="insertEducationPaperScheme" parameterType="EducationPaperScheme">
|
||||
insert into education_paper_scheme
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="schemeId != null">scheme_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="spName != null">sp_name,</if>
|
||||
<if test="quLevel != null">qu_level,</if>
|
||||
<if test="keywords != null">keywords,</if>
|
||||
<if test="pointNames != null">point_names,</if>
|
||||
<if test="quNumbers != null">qu_numbers,</if>
|
||||
<if test="quScores != null">qu_scores,</if>
|
||||
<if test="subtotalScore != null">subtotal_score,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="schemeId != null">#{schemeId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="spName != null">#{spName},</if>
|
||||
<if test="quLevel != null">#{quLevel},</if>
|
||||
<if test="keywords != null">#{keywords},</if>
|
||||
<if test="pointNames != null">#{pointNames},</if>
|
||||
<if test="quNumbers != null">#{quNumbers},</if>
|
||||
<if test="quScores != null">#{quScores},</if>
|
||||
<if test="subtotalScore != null">#{subtotalScore},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperSchemeList">
|
||||
INSERT INTO education_paper_scheme (scheme_id, task_id, sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.schemeId}, #{item.taskId}, #{item.spName}, #{item.quLevel}, #{item.keywords}, #{item.pointNames}, #{item.quNumbers}, #{item.quScores}, #{item.subtotalScore}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateEducationPaperScheme" parameterType="EducationPaperScheme">
|
||||
update education_paper_scheme
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="spName != null">sp_name = #{spName},</if>
|
||||
<if test="quLevel != null">qu_level = #{quLevel},</if>
|
||||
<if test="keywords != null">keywords = #{keywords},</if>
|
||||
<if test="pointNames != null">point_names = #{pointNames},</if>
|
||||
<if test="quNumbers != null">qu_numbers = #{quNumbers},</if>
|
||||
<if test="quScores != null">qu_scores = #{quScores},</if>
|
||||
<if test="subtotalScore != null">subtotal_score = #{subtotalScore},</if>
|
||||
</trim>
|
||||
where scheme_id = #{schemeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperSchemeBySchemeId" parameterType="String">
|
||||
delete from education_paper_scheme where scheme_id = #{schemeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperSchemeBySchemeIds" parameterType="String">
|
||||
delete from education_paper_scheme where scheme_id in
|
||||
<foreach item="schemeId" collection="array" open="(" separator="," close=")">
|
||||
#{schemeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,115 @@
|
||||
<?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.EducationPaperSessionMapper">
|
||||
|
||||
<resultMap type="EducationPaperSession" id="EducationPaperSessionResult">
|
||||
<result property="sessionId" column="session_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="batch" column="batch" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="allowEntry" column="allow_entry" />
|
||||
<result property="endAllowEntry" column="end_allow_entry" />
|
||||
<result property="allowSubmission" column="allow_submission" />
|
||||
<result property="status" column="status" />
|
||||
<result property="paperId" column="paper_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperSessionVo">
|
||||
select session_id, task_id, batch, start_time, end_time, allow_entry, end_allow_entry, allow_submission, status, paper_id from education_paper_session
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperSessionList" parameterType="EducationPaperSession" resultMap="EducationPaperSessionResult">
|
||||
<include refid="selectEducationPaperSessionVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="batch != null and batch != ''"> and batch LIKE CONCAT('%', #{batch}, '%')</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="allowEntry != null and allowEntry != ''"> and allow_entry = #{allowEntry}</if>
|
||||
<if test="endAllowEntry != null and endAllowEntry != ''"> and end_allow_entry = #{endAllowEntry}</if>
|
||||
<if test="allowSubmission != null and allowSubmission != ''"> and allow_submission = #{allowSubmission}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="paperId != null and paperId != ''"> and paper_id = #{paperId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperSessionBySessionId" parameterType="String" resultMap="EducationPaperSessionResult">
|
||||
<include refid="selectEducationPaperSessionVo"/>
|
||||
where session_id = #{sessionId}
|
||||
</select>
|
||||
<select id="selectEducationPaperSessionByTaskId" resultMap="EducationPaperSessionResult">
|
||||
<include refid="selectEducationPaperSessionVo"/>
|
||||
where task_id =#{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEducationPaperSession" parameterType="EducationPaperSession">
|
||||
insert into education_paper_session
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sessionId != null">session_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="batch != null">batch,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="allowEntry != null">allow_entry,</if>
|
||||
<if test="endAllowEntry != null">end_allow_entry,</if>
|
||||
<if test="allowSubmission != null">allow_submission,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="paperId != null">paper_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sessionId != null">#{sessionId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="batch != null">#{batch},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="allowEntry != null">#{allowEntry},</if>
|
||||
<if test="endAllowEntry != null">#{endAllowEntry},</if>
|
||||
<if test="allowSubmission != null">#{allowSubmission},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="paperId != null">#{paperId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperSessionList">
|
||||
INSERT INTO education_paper_session (session_id, task_id, batch, start_time, end_time, allow_entry, end_allow_entry, allow_submission, status, paper_id) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.sessionId}, #{item.taskId}, #{item.batch}, #{item.startTime}, #{item.endTime}, #{item.allowEntry}, #{item.endAllowEntry}, #{item.allowSubmission}, #{item.status}, #{item.paperId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateEducationPaperSession" parameterType="EducationPaperSession">
|
||||
update education_paper_session
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="batch != null">batch = #{batch},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="allowEntry != null">allow_entry = #{allowEntry},</if>
|
||||
<if test="endAllowEntry != null">end_allow_entry = #{endAllowEntry},</if>
|
||||
<if test="allowSubmission != null">allow_submission = #{allowSubmission},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="paperId != null">paper_id = #{paperId},</if>
|
||||
</trim>
|
||||
where session_id = #{sessionId}
|
||||
</update>
|
||||
<update id="changeStatus">
|
||||
UPDATE education_paper_session
|
||||
SET status = #{status}
|
||||
where session_id =#{sessionId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperSessionBySessionId" parameterType="String">
|
||||
delete from education_paper_session where session_id = #{sessionId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperSessionBySessionIds" parameterType="String">
|
||||
delete from education_paper_session where session_id in
|
||||
<foreach item="sessionId" collection="array" open="(" separator="," close=")">
|
||||
#{sessionId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,183 @@
|
||||
<?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.EducationPaperTaskMapper">
|
||||
|
||||
<resultMap type="EducationPaperTask" id="EducationPaperTaskResult">
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="taskSpecialty" column="task_specialty" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="isTemplate" column="is_template" />
|
||||
<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>
|
||||
<resultMap type="ExamKnowledgePoints" id="ExamSpecialtyResult">
|
||||
<result property="spId" column="sp_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="spName" column="sp_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="deleted" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="unite" column="unite" />
|
||||
<result property="treeNum" column="tree_num" />
|
||||
</resultMap>
|
||||
<sql id="selectEducationPaperTaskVo">
|
||||
select task_id, task_name, task_specialty, task_type, is_template, status, create_time, update_time, creator, updater, deleted,tenant_id from education_paper_task
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="selectEducationPaperTaskByTaskId" parameterType="String" resultMap="EducationPaperTaskResult">
|
||||
<include refid="selectEducationPaperTaskVo"/>
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
<select id="getSpecialityList" resultType="java.lang.String">
|
||||
select sp_name from exam_specialty
|
||||
where parent_id =0
|
||||
and del_flag='0'
|
||||
|
||||
</select>
|
||||
<select id="getCourseList" resultType="java.lang.String">
|
||||
SELECT sp_name
|
||||
FROM exam_specialty
|
||||
WHERE ancestors REGEXP '^[0-9]+,[0-9]+,[0-9]+$'
|
||||
and del_flag='0'
|
||||
|
||||
</select>
|
||||
<select id="getKeywords" resultType="java.lang.String">
|
||||
SELECT DISTINCT keywords FROM exam_question
|
||||
where deleted='0'
|
||||
|
||||
</select>
|
||||
<select id="getPoints" resultMap="ExamSpecialtyResult">
|
||||
|
||||
SELECT sp_id, parent_id, ancestors, sp_name, order_num
|
||||
FROM knowledge_points
|
||||
WHERE FIND_IN_SET(#{id}, ancestors)
|
||||
ORDER BY order_num;
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPointByid" resultType="java.lang.String">
|
||||
SELECT sp_name
|
||||
FROM knowledge_points
|
||||
WHERE sp_id IN
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getPointIdByName" resultType="java.lang.Long">
|
||||
select sp_id from knowledge_points where sp_name =#{name} limit 1
|
||||
|
||||
</select>
|
||||
<select id="getQuCount" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*)
|
||||
FROM exam_question
|
||||
WHERE specialty_name = #{taskSpecialty}
|
||||
AND subject_name = #{spName}
|
||||
AND tenant_id =#{tId}
|
||||
and audit = 0
|
||||
and status = 0
|
||||
<if test="quLevel != null and quLevel != ''">
|
||||
AND qu_level = #{quLevel}
|
||||
</if>
|
||||
|
||||
<if test="keyword != null and keyword.size > 0">
|
||||
AND (
|
||||
<foreach collection="keyword" 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>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEducationPaperTask" parameterType="EducationPaperTask">
|
||||
insert into education_paper_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="taskSpecialty != null">task_specialty,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="isTemplate != null">is_template,</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="taskId != null">#{taskId},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="taskSpecialty != null">#{taskSpecialty},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="isTemplate != null">#{isTemplate},</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>
|
||||
|
||||
<update id="updateEducationPaperTask" parameterType="EducationPaperTask">
|
||||
update education_paper_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="taskSpecialty != null">task_specialty = #{taskSpecialty},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="isTemplate != null">is_template = #{isTemplate},</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 task_id = #{taskId}
|
||||
</update>
|
||||
<update id="changeStatus">
|
||||
UPDATE education_paper_task
|
||||
set status =#{status}
|
||||
where task_id =#{taskId}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<delete id="deleteEducationPaperTaskByTaskId" parameterType="String">
|
||||
UPDATE education_paper_task
|
||||
set deleted = '2' where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperTaskByTaskIds" parameterType="String">
|
||||
UPDATE education_paper_task
|
||||
SET deleted = '2'
|
||||
WHERE task_id IN
|
||||
<foreach item="taskId" collection="taskIds" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,113 @@
|
||||
<?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.question.ExamQuestionAnswerMapper">
|
||||
<resultMap type="ExamQuestionAnswer" id="ExamQuestionAnswerResult">
|
||||
<result property="answerId" column="answer_id" />
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="isRight" column="is_right" />
|
||||
<result property="image" column="image" />
|
||||
<result property="content" column="content" />
|
||||
<result property="contentIn" column="contentIn" />
|
||||
<result property="scoreRate" column="score_rate" />
|
||||
<result property="sort" column="sort" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionAnswerVo">
|
||||
select answer_id, qu_id, is_right, image, content,contentIn, score_rate,sort from exam_question_answer
|
||||
</sql>
|
||||
|
||||
<select id="selectExamQuestionAnswerList" parameterType="ExamQuestionAnswer" resultMap="ExamQuestionAnswerResult">
|
||||
<include refid="selectExamQuestionAnswerVo"/>
|
||||
<where>
|
||||
<if test="quId != null and quId != ''"> and qu_id = #{quId}</if>
|
||||
<if test="isRight != null and isRight != ''"> and is_right = #{isRight}</if>
|
||||
<if test="image != null and image != ''"> and image = #{image}</if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="scoreRate != null and scoreRate != ''"> and score_rate = #{scoreRate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionAnswerByAnswerId" parameterType="String" resultMap="ExamQuestionAnswerResult">
|
||||
<include refid="selectExamQuestionAnswerVo"/>
|
||||
where answer_id = #{answerId}
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestionAnswer" parameterType="ExamQuestionAnswer">
|
||||
insert into exam_question_answer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="answerId != null">answer_id,</if>
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="isRight != null">is_right,</if>
|
||||
<if test="image != null">image,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="contentIn != null">contentIn,</if>
|
||||
<if test="scoreRate != null">score_rate,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="answerId != null">#{answerId},</if>
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="isRight != null">#{isRight},</if>
|
||||
<if test="image != null">#{image},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="contentIn != null">#{contentIn},</if>
|
||||
<if test="scoreRate != null">#{scoreRate},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestionAnswer" parameterType="ExamQuestionAnswer">
|
||||
update exam_question_answer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id = #{quId},</if>
|
||||
<if test="isRight != null">is_right = #{isRight},</if>
|
||||
<if test="image != null">image = #{image},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="contentIn != null">contentIn = #{contentIn},</if>
|
||||
<if test="scoreRate != null">score_rate = #{scoreRate},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
</trim>
|
||||
where answer_id = #{answerId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionAnswerByAnswerId" parameterType="String">
|
||||
delete from exam_question_answer where answer_id = #{answerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionAnswerByAnswerIds" parameterType="String">
|
||||
delete from exam_question_answer where answer_id in
|
||||
<foreach item="answerId" collection="array" open="(" separator="," close=")">
|
||||
#{answerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectExamQuestionAnswerByQuId" resultMap="ExamQuestionAnswerResult">
|
||||
<include refid="selectExamQuestionAnswerVo"/>
|
||||
<where>
|
||||
<if test="quId != null "> and qu_id = #{quId}</if>
|
||||
</where>
|
||||
ORDER BY sort ASC
|
||||
</select>
|
||||
<insert id="insertExamQuestionAnswerList">
|
||||
insert into exam_question_answer
|
||||
(answer_id, qu_id, is_right, image, content,contentIn,score_rate,sort)
|
||||
values
|
||||
<foreach collection="collection" separator="," item="item">
|
||||
(#{item.answerId},#{item.quId},#{item.isRight},#{item.image},#{item.content},#{item.contentIn},#{item.scoreRate},#{item.sort})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="deleteExamQuestionAnswerByQuesId">
|
||||
delete from exam_question_answer where qu_id = #{firstQuId}
|
||||
</delete>
|
||||
<delete id="deleteExamQuestionAnswerByQuesIds" parameterType="String">
|
||||
delete from exam_question_answer where qu_id in
|
||||
<foreach collection="ids" item="firstQuId" open="(" separator="," close=")">
|
||||
#{firstQuId}
|
||||
</foreach>
|
||||
|
||||
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,91 @@
|
||||
<?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.question.ExamQuestionKeywordMapper">
|
||||
|
||||
<resultMap type="ExamQuestionKeyword" id="ExamQuestionKeywordResult">
|
||||
<result property="keywordId" column="keyword_id" />
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="keyword" column="keyword" />
|
||||
<result property="scoreRate" column="score_rate" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionKeywordVo">
|
||||
select keyword_id, qu_id, keyword, score_rate from exam_question_keyword
|
||||
</sql>
|
||||
|
||||
<select id="selectExamQuestionKeywordList" parameterType="ExamQuestionKeyword" resultMap="ExamQuestionKeywordResult">
|
||||
<include refid="selectExamQuestionKeywordVo"/>
|
||||
<where>
|
||||
<if test="quId != null and quId != ''"> and qu_id = #{quId}</if>
|
||||
<if test="keyword != null and keyword != ''"> and keyword = #{keyword}</if>
|
||||
<if test="scoreRate != null and scoreRate != ''"> and score_rate = #{scoreRate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionKeywordByKeywordId" parameterType="String" resultMap="ExamQuestionKeywordResult">
|
||||
<include refid="selectExamQuestionKeywordVo"/>
|
||||
where keyword_id = #{keywordId}
|
||||
</select>
|
||||
<select id="selectExamQuestionKeywordByQuId" resultMap="ExamQuestionKeywordResult">
|
||||
<include refid="selectExamQuestionKeywordVo"/>
|
||||
<where>
|
||||
<if test="quId != null "> and qu_id = #{quId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestionKeyword" parameterType="ExamQuestionKeyword">
|
||||
insert into exam_question_keyword
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keywordId != null">keyword_id,</if>
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="keyword != null">keyword,</if>
|
||||
<if test="scoreRate != null">score_rate,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keywordId != null">#{keywordId},</if>
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="keyword != null">#{keyword},</if>
|
||||
<if test="scoreRate != null">#{scoreRate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertExamQuestionKeywordList">
|
||||
insert into exam_question_keyword
|
||||
(keyword_id, qu_id, keyword, score_rate)
|
||||
values
|
||||
<foreach collection="collection" separator="," item="item">
|
||||
(#{item.keywordId},#{item.quId},#{item.keyword},#{item.scoreRate})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestionKeyword" parameterType="ExamQuestionKeyword">
|
||||
update exam_question_keyword
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id = #{quId},</if>
|
||||
<if test="keyword != null">keyword = #{keyword},</if>
|
||||
<if test="scoreRate != null">score_rate = #{scoreRate},</if>
|
||||
</trim>
|
||||
where keyword_id = #{keywordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionKeywordByKeywordId" parameterType="String">
|
||||
delete from exam_question_keyword where keyword_id = #{keywordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionKeywordByKeywordIds" parameterType="String">
|
||||
delete from exam_question_keyword where keyword_id in
|
||||
<foreach item="keywordId" collection="array" open="(" separator="," close=")">
|
||||
#{keywordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteExamQuestionScoreByQuesId">
|
||||
delete from exam_question_keyword where qu_id = #{firstQuId}
|
||||
</delete>
|
||||
<delete id="deleteExamQuestionScoreByQuesIds">
|
||||
delete from exam_question_keyword where qu_id in
|
||||
<foreach collection="ids" item="firstQuId" open="(" separator="," close=")">
|
||||
#{firstQuId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,179 @@
|
||||
<?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.question.ExamQuestionMapper">
|
||||
|
||||
<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" />
|
||||
|
||||
|
||||
<!-- 嵌套答案列表 -->
|
||||
<collection property="answerList" ofType="pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer">
|
||||
<id property="answerId" column="answer_id"/>
|
||||
<result property="quId" column="a_qu_id"/>
|
||||
<result property="isRight" column="is_right"/>
|
||||
<result property="image" column="image"/>
|
||||
<result property="content" column="a_content"/>
|
||||
<result property="contentIn" column="a_content_in"/>
|
||||
<result property="scoreRate" column="score_rate"/>
|
||||
<result property="sort" column="sort"/>
|
||||
</collection>
|
||||
</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
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="selectExamQuestionByQuId" parameterType="String" resultMap="ExamQuestionResult">
|
||||
<include refid="selectExamQuestionVo"/>
|
||||
where qu_id = #{quId}
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionListByQuIds" resultMap="ExamQuestionResult">
|
||||
SELECT
|
||||
q.*, -- exam_question 表字段
|
||||
a.answer_id,
|
||||
a.qu_id AS a_qu_id,
|
||||
a.is_right,
|
||||
a.image,
|
||||
a.content AS a_content,
|
||||
a.contentIn AS a_content_in,
|
||||
a.score_rate,
|
||||
a.sort
|
||||
FROM exam_question q
|
||||
LEFT JOIN exam_question_answer a ON q.qu_id = a.qu_id
|
||||
WHERE q.qu_id IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
ORDER BY
|
||||
CASE WHEN a.sort IS NOT NULL THEN 0 ELSE 1 END,
|
||||
a.sort ASC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertExamQuestion" parameterType="ExamQuestion">
|
||||
insert into exam_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="quBankId != null">qu_bank_id,</if>
|
||||
<if test="quBankName != null">qu_bank_name,</if>
|
||||
<if test="chapteridDictText != null">chapterId_dict_text,</if>
|
||||
<if test="subjectName != null">subject_name,</if>
|
||||
<if test="quLevel != null">qu_level,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="contentText != null">content_text,</if>
|
||||
<if test="analysis != null">analysis,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="pointNames != null">point_names,</if>
|
||||
<if test="keywords != null">keywords,</if>
|
||||
<if test="manual != null">manual,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="creator != null">creator,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updater != null">updater,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="audit != null">audit,</if>
|
||||
<if test="courseName != null">course_name,</if>
|
||||
<if test="specialtyName != null">specialty_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="quBankId != null">#{quBankId},</if>
|
||||
<if test="quBankName != null">#{quBankName},</if>
|
||||
<if test="chapteridDictText != null">#{chapteridDictText},</if>
|
||||
<if test="subjectName != null">#{subjectName},</if>
|
||||
<if test="quLevel != null">#{quLevel},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="contentText != null">#{contentText},</if>
|
||||
<if test="analysis != null">#{analysis},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="pointNames != null">#{pointNames},</if>
|
||||
<if test="keywords != null">#{keywords},</if>
|
||||
<if test="manual != null">#{manual},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="creator != null">#{creator},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updater != null">#{updater},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="audit != null">#{audit},</if>
|
||||
<if test="courseName != null">#{courseName},</if>
|
||||
<if test="specialtyName != null">#{specialtyName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestion" parameterType="ExamQuestion">
|
||||
update exam_question
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quBankId != null">qu_bank_id = #{quBankId},</if>
|
||||
<if test="quBankName != null">qu_bank_name = #{quBankName},</if>
|
||||
<if test="chapteridDictText != null">chapterId_dict_text = #{chapteridDictText},</if>
|
||||
<if test="subjectName != null">subject_name = #{subjectName},</if>
|
||||
<if test="quLevel != null">qu_level = #{quLevel},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="contentText != null">content_text = #{contentText},</if>
|
||||
<if test="analysis != null">analysis = #{analysis},</if>
|
||||
<if test="pointNames != null">point_names = #{pointNames},</if>
|
||||
<if test="keywords != null">keywords = #{keywords},</if>
|
||||
<if test="manual != null">manual = #{manual},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="creator != null">creator = #{creator},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updater != null">updater = #{updater},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="audit != null">audit = #{audit},</if>
|
||||
<if test="courseName != null">course_name = #{courseName},</if>
|
||||
<if test="specialtyName != null">specialty_name = #{specialtyName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
</trim>
|
||||
where qu_id = #{quId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionByQuId" parameterType="String">
|
||||
UPDATE exam_question set deleted ='2' where qu_id = #{quId}
|
||||
</delete>
|
||||
|
||||
<update id="deleteExamQuestionByQuIds" parameterType="String">
|
||||
UPDATE exam_question
|
||||
SET deleted = '2'
|
||||
WHERE qu_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,131 @@
|
||||
<?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.question.ExamQuestionScoreMapper">
|
||||
|
||||
<resultMap type="ExamQuestionScore" id="ExamQuestionScoreResult">
|
||||
<result property="scoreId" column="score_id" />
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="isPass" column="is_pass" />
|
||||
<result property="isResult" column="is_result" />
|
||||
<result property="isKeyword" column="is_keyword" />
|
||||
<result property="isCompile" column="is_compile" />
|
||||
<result property="isPassScore" column="is_pass_score" />
|
||||
<result property="isResultScore" column="is_result_score" />
|
||||
<result property="isKeywordScore" column="is_keyword_score" />
|
||||
<result property="isCompileScore" column="is_compile_score" />
|
||||
<result property="keywordCutoff" column="keyword_cutoff" />
|
||||
<result property="compileCutoff" column="compile_cutoff" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExamQuestionScoreVo">
|
||||
select score_id, qu_id, is_pass, is_result, is_keyword,is_compile, is_pass_score, is_result_score, is_keyword_score ,is_compile_score,keyword_cutoff,compile_cutoff from exam_question_score
|
||||
</sql>
|
||||
|
||||
<select id="selectExamQuestionScoreList" parameterType="ExamQuestionScore" resultMap="ExamQuestionScoreResult">
|
||||
<include refid="selectExamQuestionScoreVo"/>
|
||||
<where>
|
||||
<if test="quId != null and quId != ''"> and qu_id = #{quId}</if>
|
||||
<if test="isPass != null and isPass != ''"> and is_pass = #{isPass}</if>
|
||||
<if test="isResult != null and isResult != ''"> and is_result = #{isResult}</if>
|
||||
<if test="isKeyword != null and isKeyword != ''"> and is_keyword = #{isKeyword}</if>
|
||||
<if test="isCompile != null and isCompile != ''"> and is_compile = #{isCompile}</if>
|
||||
<if test="isPassScore != null and isPassScore != ''"> and is_pass_score = #{isPassScore}</if>
|
||||
<if test="isResultScore != null and isResultScore != ''"> and is_result_score = #{isResultScore}</if>
|
||||
<if test="isKeywordScore != null and isKeywordScore != ''"> and is_keyword_score = #{isKeywordScore}</if>
|
||||
<if test="isCompileScore != null and isCompileScore != ''"> and is_compile_score = #{isCompileScore}</if>
|
||||
<if test="keywordCutoff != null and keywordCutoff != ''"> and keyword_cutoff = #{keywordCutoff}</if>
|
||||
<if test="compileCutoff != null and compileCutoff != ''"> and compile_cutoff = #{compileCutoff}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamQuestionScoreByScoreId" parameterType="String" resultMap="ExamQuestionScoreResult">
|
||||
<include refid="selectExamQuestionScoreVo"/>
|
||||
where score_id = #{scoreId}
|
||||
</select>
|
||||
<select id="selectExamQuestionScoreByQuId" resultMap="ExamQuestionScoreResult">
|
||||
<include refid="selectExamQuestionScoreVo"/>
|
||||
<where>
|
||||
<if test="quId != null "> and qu_id = #{quId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertExamQuestionScore" parameterType="ExamQuestionScore">
|
||||
insert into exam_question_score
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="scoreId != null">score_id,</if>
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="isPass != null">is_pass,</if>
|
||||
<if test="isResult != null">is_result,</if>
|
||||
<if test="isKeyword != null">is_keyword,</if>
|
||||
<if test="isCompile != null">is_compile,</if>
|
||||
<if test="isPassScore != null">is_pass_score,</if>
|
||||
<if test="isResultScore != null">is_result_score,</if>
|
||||
<if test="isKeywordScore != null">is_keyword_score,</if>
|
||||
<if test="isCompileScore != null">is_compile_score,</if>
|
||||
<if test="keywordCutoff != null">keyword_cutoff,</if>
|
||||
<if test="compileCutoff != null">compile_cutoff,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="scoreId != null">#{scoreId},</if>
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="isPass != null">#{isPass},</if>
|
||||
<if test="isResult != null">#{isResult},</if>
|
||||
<if test="isKeyword != null">#{isKeyword},</if>
|
||||
<if test="isCompile != null">#{isCompile},</if>
|
||||
<if test="isPassScore != null">#{isPassScore},</if>
|
||||
<if test="isResultScore != null">#{isResultScore},</if>
|
||||
<if test="isKeywordScore != null">#{isKeywordScore},</if>
|
||||
<if test="isCompileScore != null">#{isCompileScore},</if>
|
||||
<if test="keywordCutoff != null">#{keywordCutoff},</if>
|
||||
<if test="compileCutoff != null">#{compileCutoff},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertExamQuestionScoreList">
|
||||
insert into exam_question_score
|
||||
(score_id, qu_id,is_pass,is_result,is_keyword,is_compile,is_pass_score,is_result_score,is_keyword_score,is_compile_score,keyword_cutoff,compile_cutoff)
|
||||
values
|
||||
<foreach collection="collection" separator="," item="item">
|
||||
(#{item.scoreId},#{item.quId},#{item.isPass},#{item.isResult},#{item.isKeyword},#{item.isCompile},#{item.isPassScore},#{item.isResultScore},#{item.isKeywordScore},#{item.isCompileScore},#{item.keywordCutoff},#{item.compileCutoff})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamQuestionScore" parameterType="ExamQuestionScore">
|
||||
update exam_question_score
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id = #{quId},</if>
|
||||
<if test="isPass != null">is_pass = #{isPass},</if>
|
||||
<if test="isResult != null">is_result = #{isResult},</if>
|
||||
<if test="isKeyword != null">is_keyword = #{isKeyword},</if>
|
||||
<if test="isCompile != null">is_compile = #{isCompile},</if>
|
||||
<if test="isPassScore != null">is_pass_score = #{isPassScore},</if>
|
||||
<if test="isResultScore != null">is_result_score = #{isResultScore},</if>
|
||||
<if test="isKeywordScore != null">is_keyword_score = #{isKeywordScore},</if>
|
||||
<if test="isCompileScore != null">is_compile_score = #{isCompileScore},</if>
|
||||
<if test="keywordCutoff != null">keyword_cutoff = #{keywordCutoff},</if>
|
||||
<if test="compileCutoff != null">compile_cutoff = #{compileCutoff},</if>
|
||||
</trim>
|
||||
where score_id = #{scoreId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamQuestionScoreByScoreId" parameterType="String">
|
||||
delete from exam_question_score where score_id = #{scoreId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamQuestionScoreByScoreIds" parameterType="String">
|
||||
delete from exam_question_score where score_id in
|
||||
<foreach item="scoreId" collection="array" open="(" separator="," close=")">
|
||||
#{scoreId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteExamQuestionScoreByQuesId">
|
||||
delete from exam_question_score where qu_id = #{firstQuId}
|
||||
</delete>
|
||||
<delete id="deleteExamQuestionScoreByQuesIds">
|
||||
delete from exam_question_score where qu_id in
|
||||
<foreach collection="firstQuIds" item="firstQuId" open="(" separator="," close=")">
|
||||
#{firstQuId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,91 @@
|
||||
<?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.question.SysFileMapper">
|
||||
|
||||
<resultMap type="SysFileUpload" id="SysFileResult">
|
||||
<result property="fileId" column="file_id" />
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="url" column="url" />
|
||||
<result property="fileType" column="file_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysFileVo">
|
||||
select file_id, qu_id, url, file_type from sys_file
|
||||
</sql>
|
||||
|
||||
<select id="selectSysFileList" parameterType="SysFileUpload" resultMap="SysFileResult">
|
||||
<include refid="selectSysFileVo"/>
|
||||
<where>
|
||||
<if test="quId != null "> and qu_id = #{quId}</if>
|
||||
<if test="fileId != null "> and file_id = #{fileId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysFileByFileId" parameterType="String" resultMap="SysFileResult">
|
||||
<include refid="selectSysFileVo"/>
|
||||
where file_id = #{fileId}
|
||||
</select>
|
||||
<select id="selectSysFileByQuid" resultMap="SysFileResult">
|
||||
<include refid="selectSysFileVo"/>
|
||||
<where>
|
||||
<if test="quId != null "> and qu_id = #{quId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSysFile" parameterType="SysFileUpload">
|
||||
insert into sys_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">file_id,</if>
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="url != null">url,</if>
|
||||
<if test="fileType != null">file_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="url != null">#{url},</if>
|
||||
<if test="fileType != null">#{fileType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertSysFileList">
|
||||
insert into sys_file
|
||||
(file_id, qu_id,url,file_type)
|
||||
values
|
||||
<foreach collection="collection" separator="," item="item">
|
||||
(#{item.fileId},#{item.quId},#{item.url},#{item.fileType})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysFile" parameterType="SysFileUpload">
|
||||
update sys_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id = #{quId},</if>
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="fileType != null">file_type = #{fileType},</if>
|
||||
</trim>
|
||||
where file_id = #{fileId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysFileByFileId" parameterType="String">
|
||||
delete from sys_file where file_id = #{fileId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysFileByFileIds" parameterType="String">
|
||||
delete from sys_file where file_id in
|
||||
<foreach item="fileId" collection="array" open="(" separator="," close=")">
|
||||
#{fileId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteSysFileByQuesId">
|
||||
delete from sys_file where qu_id = #{firstQuId}
|
||||
</delete>
|
||||
<delete id="deleteSysFileByQuesIds">
|
||||
delete from sys_file where qu_id in
|
||||
<foreach collection="firstQuIds" item="firstQuId" open="(" separator="," close=")">
|
||||
#{firstQuId}
|
||||
</foreach>
|
||||
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user