This commit is contained in:
lu7213 committed 2025-12-02 23:07:47 +08:00
1 parent 81eca8933a
commit 345f906c35
540 files changed
+494222 -90

No files matched your search

@@ -0,0 +1,200 @@
<?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.luqj.exam.mapper.ExamQuestionMapper">
<resultMap type="ExamQuestion" id="ExamQuestionResult">
<result property="id" column="id" />
<result property="no" column="no" />
<result property="question" column="question" />
<result property="optionA" column="option_a" />
<result property="optionB" column="option_b" />
<result property="optionC" column="option_c" />
<result property="optionD" column="option_d" />
<result property="optionE" column="option_e" />
<result property="optionF" column="option_f" />
<result property="optionG" column="option_g" />
<result property="score" column="score" />
<result property="difficulty" column="difficulty" />
<result property="pointId" column="point_id" />
<result property="answer" column="answer" />
<result property="analysisUrl" column="analysis_url" />
<result property="analysis" column="analysis" />
<result property="provinceId" column="province_id" />
<result property="cityId" column="city_id" />
<result property="schoolId" column="school_id" />
<result property="categoryId" column="category_id" />
<result property="courseId" column="course_id" />
<result property="type" column="type" />
<result property="examId" column="exam_id" />
<result property="source" column="source" />
<result property="createTime" column="create_time" />
<result property="creatorId" column="creator_id" />
<result property="auditorId" column="auditor_id" />
<result property="updateTime" column="update_time" />
<result property="updaterId" column="updater_id" />
<result property="status" column="status" />
<result property="isDelete" column="is_delete" />
</resultMap>
<sql id="selectExamQuestionVo">
select id, no, question, option_a, option_b, option_c, option_d, option_e, option_f, option_g, score, difficulty, point_id, answer, analysis_url, analysis, province_id, city_id, school_id, category_id, course_id, type, exam_id, source, create_time, creator_id, auditor_id, update_time, updater_id, status, is_delete from exam_question
</sql>
<select id="selectExamQuestionList" parameterType="ExamQuestion" resultMap="ExamQuestionResult">
<include refid="selectExamQuestionVo"/>
<where>
<if test="no != null and no != ''"> and no = #{no}</if>
<if test="question != null and question != ''"> and question LIKE concat(#{question},"%")</if>
<if test="optionA != null and optionA != ''"> and option_a = #{optionA}</if>
<if test="optionB != null and optionB != ''"> and option_b = #{optionB}</if>
<if test="optionC != null and optionC != ''"> and option_c = #{optionC}</if>
<if test="optionD != null and optionD != ''"> and option_d = #{optionD}</if>
<if test="optionE != null and optionE != ''"> and option_e = #{optionE}</if>
<if test="optionF != null and optionF != ''"> and option_f = #{optionF}</if>
<if test="optionG != null and optionG != ''"> and option_g = #{optionG}</if>
<if test="score != null "> and score = #{score}</if>
<if test="difficulty != null "> and difficulty = #{difficulty}</if>
<if test="pointId != null "> and point_id = #{pointId}</if>
<if test="answer != null and answer != ''"> and answer = #{answer}</if>
<if test="analysisUrl != null and analysisUrl != ''"> and analysis_url = #{analysisUrl}</if>
<if test="analysis != null and analysis != ''"> and analysis = #{analysis}</if>
<if test="provinceId != null "> and province_id = #{provinceId}</if>
<if test="cityId != null "> and city_id = #{cityId}</if>
<if test="schoolId != null "> and school_id = #{schoolId}</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="courseId != null "> and course_id = #{courseId}</if>
<if test="type != null "> and type = #{type}</if>
<if test="examId != null "> and exam_id = #{examId}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="creatorId != null "> and creator_id = #{creatorId}</if>
<if test="auditorId != null "> and auditor_id = #{auditorId}</if>
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
<if test="status != null "> and status = #{status}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
</where>
order by id desc
</select>
<select id="selectExamQuestionById" parameterType="Long" resultMap="ExamQuestionResult">
<include refid="selectExamQuestionVo"/>
where id = #{id}
</select>
<insert id="insertExamQuestion" parameterType="ExamQuestion" useGeneratedKeys="true" keyProperty="id">
insert into exam_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="no != null">no,</if>
<if test="question != null">question,</if>
<if test="optionA != null">option_a,</if>
<if test="optionB != null">option_b,</if>
<if test="optionC != null">option_c,</if>
<if test="optionD != null">option_d,</if>
<if test="optionE != null">option_e,</if>
<if test="optionF != null">option_f,</if>
<if test="optionG != null">option_g,</if>
<if test="score != null">score,</if>
<if test="difficulty != null">difficulty,</if>
<if test="pointId != null">point_id,</if>
<if test="answer != null">answer,</if>
<if test="analysisUrl != null">analysis_url,</if>
<if test="analysis != null">analysis,</if>
<if test="provinceId != null">province_id,</if>
<if test="cityId != null">city_id,</if>
<if test="schoolId != null">school_id,</if>
<if test="categoryId != null">category_id,</if>
<if test="courseId != null">course_id,</if>
<if test="type != null">type,</if>
<if test="examId != null">exam_id,</if>
<if test="source != null">source,</if>
<if test="createTime != null">create_time,</if>
<if test="creatorId != null">creator_id,</if>
<if test="auditorId != null">auditor_id,</if>
<if test="updateTime != null">update_time,</if>
<if test="updaterId != null">updater_id,</if>
<if test="status != null">status,</if>
<if test="isDelete != null">is_delete,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="no != null">#{no},</if>
<if test="question != null">#{question},</if>
<if test="optionA != null">#{optionA},</if>
<if test="optionB != null">#{optionB},</if>
<if test="optionC != null">#{optionC},</if>
<if test="optionD != null">#{optionD},</if>
<if test="optionE != null">#{optionE},</if>
<if test="optionF != null">#{optionF},</if>
<if test="optionG != null">#{optionG},</if>
<if test="score != null">#{score},</if>
<if test="difficulty != null">#{difficulty},</if>
<if test="pointId != null">#{pointId},</if>
<if test="answer != null">#{answer},</if>
<if test="analysisUrl != null">#{analysisUrl},</if>
<if test="analysis != null">#{analysis},</if>
<if test="provinceId != null">#{provinceId},</if>
<if test="cityId != null">#{cityId},</if>
<if test="schoolId != null">#{schoolId},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="courseId != null">#{courseId},</if>
<if test="type != null">#{type},</if>
<if test="examId != null">#{examId},</if>
<if test="source != null">#{source},</if>
<if test="createTime != null">#{createTime},</if>
<if test="creatorId != null">#{creatorId},</if>
<if test="auditorId != null">#{auditorId},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updaterId != null">#{updaterId},</if>
<if test="status != null">#{status},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
<update id="updateExamQuestion" parameterType="ExamQuestion">
update exam_question
<trim prefix="SET" suffixOverrides=",">
<if test="no != null">no = #{no},</if>
<if test="question != null">question = #{question},</if>
<if test="optionA != null">option_a = #{optionA},</if>
<if test="optionB != null">option_b = #{optionB},</if>
<if test="optionC != null">option_c = #{optionC},</if>
<if test="optionD != null">option_d = #{optionD},</if>
<if test="optionE != null">option_e = #{optionE},</if>
<if test="optionF != null">option_f = #{optionF},</if>
<if test="optionG != null">option_g = #{optionG},</if>
<if test="score != null">score = #{score},</if>
<if test="difficulty != null">difficulty = #{difficulty},</if>
<if test="pointId != null">point_id = #{pointId},</if>
<if test="answer != null">answer = #{answer},</if>
<if test="analysisUrl != null">analysis_url = #{analysisUrl},</if>
<if test="analysis != null">analysis = #{analysis},</if>
<if test="provinceId != null">province_id = #{provinceId},</if>
<if test="cityId != null">city_id = #{cityId},</if>
<if test="schoolId != null">school_id = #{schoolId},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="courseId != null">course_id = #{courseId},</if>
<if test="type != null">type = #{type},</if>
<if test="examId != null">exam_id = #{examId},</if>
<if test="source != null">source = #{source},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="auditorId != null">auditor_id = #{auditorId},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updaterId != null">updater_id = #{updaterId},</if>
<if test="status != null">status = #{status},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteExamQuestionById" parameterType="Long">
delete from exam_question where id = #{id}
</delete>
<delete id="deleteExamQuestionByIds" parameterType="String">
delete from exam_question where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>