111
This commit is contained in:
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.ExamPaperMapper">
|
||||
<resultMap type="ExamPaper" id="ExamPaperResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="no" column="no" />
|
||||
<result property="imgUrl" column="img_url" />
|
||||
<result property="provinceId" column="province_id" />
|
||||
<result property="cityId" column="city_id" />
|
||||
<result property="schoolId" column="school_id" />
|
||||
<result property="courseId" column="course_id" />
|
||||
<result property="teacherId" column="teacher_id" />
|
||||
<result property="auditorId" column="auditor_id" />
|
||||
<result property="year" column="year" />
|
||||
<result property="semester" column="semester" />
|
||||
<result property="unionType" column="union_type" />
|
||||
<result property="type" column="type" />
|
||||
<result property="difficulty" column="difficulty" />
|
||||
<result property="score" column="score" />
|
||||
<result property="passScore" column="pass_score" />
|
||||
<result property="examTime" column="exam_time" />
|
||||
<result property="timeLength" column="time_length" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="status" column="status" />
|
||||
<result property="categoryId" column="category_id" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ExamPaperExamPaperModuleResult" type="ExamPaper" extends="ExamPaperResult">
|
||||
<collection property="examPaperModuleList" notNullColumn="id" javaType="java.util.List" resultMap="ExamPaperModuleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ExamPaperModule" id="ExamPaperModuleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="paperId" column="paper_id" />
|
||||
<result property="moduleName" column="module_name" />
|
||||
<result property="questionTypeId" column="question_type_id" />
|
||||
<result property="timeLength" column="time_length" />
|
||||
<result property="imgUrl" column="img_url" />
|
||||
<result property="score" column="score" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="sortNum" column="sort_num" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExamPaperVo">
|
||||
select id, name, no, img_url, province_id, city_id, school_id, course_id, teacher_id, auditor_id, year, semester, union_type, type, difficulty, score, pass_score, exam_time, time_length, create_time, update_time, is_delete, status, category_id from exam_paper
|
||||
</sql>
|
||||
|
||||
<select id="selectExamPaperList" parameterType="ExamPaper" resultMap="ExamPaperResult">
|
||||
<include refid="selectExamPaperVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="no != null and no != ''"> and no = #{no}</if>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</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="courseId != null "> and course_id = #{courseId}</if>
|
||||
<if test="teacherId != null "> and teacher_id = #{teacherId}</if>
|
||||
<if test="auditorId != null "> and auditor_id = #{auditorId}</if>
|
||||
<if test="year != null "> and year = #{year}</if>
|
||||
<if test="semester != null "> and semester = #{semester}</if>
|
||||
<if test="unionType != null "> and union_type = #{unionType}</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="difficulty != null "> and difficulty = #{difficulty}</if>
|
||||
<if test="score != null "> and score = #{score}</if>
|
||||
<if test="passScore != null "> and pass_score = #{passScore}</if>
|
||||
<if test="examTime != null "> and exam_time = #{examTime}</if>
|
||||
<if test="timeLength != null "> and time_length = #{timeLength}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExamPaperById" parameterType="Long" resultMap="ExamPaperExamPaperModuleResult">
|
||||
select a.id, a.name, a.no, a.img_url, a.province_id, a.city_id, a.school_id, a.course_id, a.teacher_id, a.auditor_id, a.year, a.semester, a.union_type, a.type, a.difficulty, a.score, a.pass_score, a.exam_time, a.time_length, a.create_time, a.update_time, a.is_delete, a.status, a.category_id,
|
||||
b.id, b.paper_id, b.module_name, b.question_type_id, b.time_length, b.img_url, b.score, b.create_time, b.sort_num
|
||||
from exam_paper a
|
||||
left join exam_paper_module b on b.paper_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertExamPaper" parameterType="ExamPaper" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into exam_paper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="no != null">no,</if>
|
||||
<if test="imgUrl != null">img_url,</if>
|
||||
<if test="provinceId != null">province_id,</if>
|
||||
<if test="cityId != null">city_id,</if>
|
||||
<if test="schoolId != null">school_id,</if>
|
||||
<if test="courseId != null">course_id,</if>
|
||||
<if test="teacherId != null">teacher_id,</if>
|
||||
<if test="auditorId != null">auditor_id,</if>
|
||||
<if test="year != null">year,</if>
|
||||
<if test="semester != null">semester,</if>
|
||||
<if test="unionType != null">union_type,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="difficulty != null">difficulty,</if>
|
||||
<if test="score != null">score,</if>
|
||||
<if test="passScore != null">pass_score,</if>
|
||||
<if test="examTime != null">exam_time,</if>
|
||||
<if test="timeLength != null">time_length,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="categoryId != null">category_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="no != null">#{no},</if>
|
||||
<if test="imgUrl != null">#{imgUrl},</if>
|
||||
<if test="provinceId != null">#{provinceId},</if>
|
||||
<if test="cityId != null">#{cityId},</if>
|
||||
<if test="schoolId != null">#{schoolId},</if>
|
||||
<if test="courseId != null">#{courseId},</if>
|
||||
<if test="teacherId != null">#{teacherId},</if>
|
||||
<if test="auditorId != null">#{auditorId},</if>
|
||||
<if test="year != null">#{year},</if>
|
||||
<if test="semester != null">#{semester},</if>
|
||||
<if test="unionType != null">#{unionType},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="difficulty != null">#{difficulty},</if>
|
||||
<if test="score != null">#{score},</if>
|
||||
<if test="passScore != null">#{passScore},</if>
|
||||
<if test="examTime != null">#{examTime},</if>
|
||||
<if test="timeLength != null">#{timeLength},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="categoryId != null">#{categoryId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExamPaper" parameterType="ExamPaper">
|
||||
update exam_paper
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="no != null">no = #{no},</if>
|
||||
<if test="imgUrl != null">img_url = #{imgUrl},</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="courseId != null">course_id = #{courseId},</if>
|
||||
<if test="teacherId != null">teacher_id = #{teacherId},</if>
|
||||
<if test="auditorId != null">auditor_id = #{auditorId},</if>
|
||||
<if test="year != null">year = #{year},</if>
|
||||
<if test="semester != null">semester = #{semester},</if>
|
||||
<if test="unionType != null">union_type = #{unionType},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="difficulty != null">difficulty = #{difficulty},</if>
|
||||
<if test="score != null">score = #{score},</if>
|
||||
<if test="passScore != null">pass_score = #{passScore},</if>
|
||||
<if test="examTime != null">exam_time = #{examTime},</if>
|
||||
<if test="timeLength != null">time_length = #{timeLength},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="categoryId != null">category_id = #{categoryId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExamPaperById" parameterType="Long">
|
||||
delete from exam_paper where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamPaperByIds" parameterType="String">
|
||||
delete from exam_paper where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamPaperModuleByPaperIds" parameterType="String">
|
||||
delete from exam_paper_module where paper_id in
|
||||
<foreach item="paperId" collection="array" open="(" separator="," close=")">
|
||||
#{paperId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExamPaperModuleByPaperId" parameterType="Long">
|
||||
delete from exam_paper_module where paper_id = #{paperId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchExamPaperModule">
|
||||
insert into exam_paper_module( id, paper_id, module_name, question_type_id, time_length, img_url, score, create_time, sort_num) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.paperId}, #{item.moduleName}, #{item.questionTypeId}, #{item.timeLength}, #{item.imgUrl}, #{item.score}, #{item.createTime}, #{item.sortNum})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user