|
@@ -12,8 +12,11 @@
|
|
|
<result column="exam_mode_" property="examMode" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="exam_location_id_" property="examLocationId" />
|
|
|
<result column="subject_id_list_" property="subjectIdList" />
|
|
|
+ <result column="subject_name_list_" property="subjectNameList"/>
|
|
|
<result column="main_teacher_user_id_" property="mainTeacherUserId" />
|
|
|
+ <result column="main_teacher_user_name_" property="mainTeacherName"/>
|
|
|
<result column="assistant_teacher_user_id_list_" property="assistantTeacherUserIdList" />
|
|
|
+ <result column="assistant_teacher_user_name_list_" property="assistantTeacherUserNameList"/>
|
|
|
<result column="exam_start_time_" property="examStartTime" />
|
|
|
<result column="exam_end_time_" property="examEndTime" />
|
|
|
<result column="del_flag_" property="delFlag" />
|
|
@@ -37,23 +40,26 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
|
|
|
- assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
|
|
|
+ INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,subject_name_list_,
|
|
|
+ main_teacher_user_id_,main_teacher_user_name_,assistant_teacher_user_id_list_,assistant_teacher_user_name_list_,
|
|
|
+ exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
|
|
|
exam_room_student_num_,create_time_,update_time_,tenant_id_)
|
|
|
- VALUES(#{id},#{examinationBasicId},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examLocationId},#{subjectIdList},
|
|
|
- #{mainTeacherUserId},#{assistantTeacherUserIdList},
|
|
|
+ VALUES(#{id},#{examinationBasicId},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examLocationId},
|
|
|
+ #{subjectIdList},#{subjectNameList},#{mainTeacherUserId},#{mainTeacherName},#{assistantTeacherUserIdList},#{assistantTeacherUserNameList},
|
|
|
#{examStartTime},#{examEndTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
#{examRoomStudentNum},NOW(),NOW(),#{tenantId})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_room (examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
|
|
|
- assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
|
|
|
+ INSERT INTO exam_room (examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,subject_name_list_,
|
|
|
+ main_teacher_user_id_,main_teacher_user_name_,assistant_teacher_user_id_list_,assistant_teacher_user_name_list_,
|
|
|
+ exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
|
|
|
exam_room_student_num_,create_time_,update_time_,tenant_id_)
|
|
|
VALUES
|
|
|
<foreach collection="examRooms" item="examRoom" separator=",">
|
|
|
(#{examRoom.examinationBasicId},#{examRoom.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examRoom.examLocationId},
|
|
|
- #{examRoom.subjectIdList},#{examRoom.mainTeacherUserId},#{examRoom.assistantTeacherUserIdList},
|
|
|
+ #{examRoom.subjectIdList},#{examRoom.subjectNameList},
|
|
|
+ #{examRoom.mainTeacherUserId},#{examRoom.mainTeacherName},#{examRoom.assistantTeacherUserIdList},#{examRoom.assistantTeacherUserNameList},
|
|
|
#{examRoom.examStartTime},#{examRoom.examEndTime},#{examRoom.delFlag},#{examRoom.organId},#{examRoom.examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
#{examRoom.examRoomStudentNum},NOW(),NOW(),#{examRoom.tenantId})
|
|
|
</foreach>
|
|
@@ -78,6 +84,9 @@
|
|
|
<if test="subjectIdList != null">
|
|
|
subject_id_list_ = #{subjectIdList},
|
|
|
</if>
|
|
|
+ <if test="subjectNameList != null">
|
|
|
+ subject_name_list_ = #{subjectNameList},
|
|
|
+ </if>
|
|
|
<if test="tenantId != null">
|
|
|
tenant_id_ = #{tenantId},
|
|
|
</if>
|
|
@@ -90,9 +99,15 @@
|
|
|
<if test="mainTeacherUserId != null">
|
|
|
main_teacher_user_id_ = #{mainTeacherUserId},
|
|
|
</if>
|
|
|
+ <if test="mainTeacherName != null">
|
|
|
+ main_teacher_user_name_ = #{mainTeacherName},
|
|
|
+ </if>
|
|
|
<if test="assistantTeacherUserIdList != null">
|
|
|
assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
|
|
|
</if>
|
|
|
+ <if test="assistantTeacherUserNameList != null">
|
|
|
+ assistant_teacher_user_name_list_ = #{assistantTeacherUserNameList},
|
|
|
+ </if>
|
|
|
<if test="organId != null">
|
|
|
organ_id_ = #{organId},
|
|
|
</if>
|
|
@@ -124,6 +139,9 @@
|
|
|
<if test="subjectIdList != null">
|
|
|
subject_id_list_ = #{subjectIdList},
|
|
|
</if>
|
|
|
+ <if test="subjectNameList != null">
|
|
|
+ subject_name_list_ = #{subjectNameList},
|
|
|
+ </if>
|
|
|
<if test="tenantId != null">
|
|
|
tenant_id_ = #{tenantId},
|
|
|
</if>
|
|
@@ -136,9 +154,15 @@
|
|
|
<if test="mainTeacherUserId != null">
|
|
|
main_teacher_user_id_ = #{mainTeacherUserId},
|
|
|
</if>
|
|
|
+ <if test="mainTeacherName != null">
|
|
|
+ main_teacher_user_name_ = #{mainTeacherName},
|
|
|
+ </if>
|
|
|
<if test="assistantTeacherUserIdList != null">
|
|
|
assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
|
|
|
</if>
|
|
|
+ <if test="assistantTeacherUserNameList != null">
|
|
|
+ assistant_teacher_user_name_list_ = #{assistantTeacherUserNameList},
|
|
|
+ </if>
|
|
|
<if test="organId != null">
|
|
|
organ_id_ = #{organId},
|
|
|
</if>
|
|
@@ -207,8 +231,8 @@
|
|
|
</sql>
|
|
|
|
|
|
<resultMap type="com.keao.edu.user.dto.ExamRoomDto" id="ExamRoomDto" extends="ExamRoom">
|
|
|
- <association property="examLocation" javaType="com.keao.edu.user.entity.ExamLocation" resultMap="com.keao.edu.user.dao.ExamLocationDao.ExamLocation"/>
|
|
|
- <association property="examinationBasic" javaType="com.keao.edu.user.entity.ExaminationBasic" resultMap="com.keao.edu.user.dao.ExaminationBasicDao.ExaminationBasic"/>
|
|
|
+ <association property="examLocation" columnPrefix="el_" resultMap="com.keao.edu.user.dao.ExamLocationDao.ExamLocation"/>
|
|
|
+ <association property="examinationBasic" columnPrefix="exam_" resultMap="com.keao.edu.user.dao.ExaminationBasicDao.ExaminationBasic"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="countExamRoomPage" resultType="java.lang.Integer">
|
|
@@ -219,7 +243,12 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryExamRoomPage" resultMap="ExamRoomDto">
|
|
|
- SELECT er.*,eb.* FROM exam_room er
|
|
|
+ SELECT
|
|
|
+ er.*,
|
|
|
+ el.id_ el_id_,
|
|
|
+ el.name_ el_name_,
|
|
|
+ eb.name_ exam_name_
|
|
|
+ FROM exam_room er
|
|
|
LEFT JOIN exam_location el ON er.exam_location_id_ = el.id_ AND er.tenant_id_ = el.tenant_id_
|
|
|
LEFT JOIN examination_basic eb ON FIND_IN_SET(er.exam_location_id_,eb.exam_location_id_list_) AND er.tenant_id_ = eb.tenant_id_
|
|
|
<include refid="queryExamRoomPageSql"/>
|
|
@@ -255,4 +284,7 @@
|
|
|
#{day}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="getWithExamAndSubject" resultMap="ExamRoom">
|
|
|
+ SELECT * FROM exam_room WHERE examination_basic_id_=#{examId} AND FIND_IN_SET(#{subjectId}, subject_id_list_);
|
|
|
+ </select>
|
|
|
</mapper>
|