|
@@ -9,6 +9,7 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.StudentCourseHomework" id="StudentCourseHomework">
|
|
|
<result column="id_" property="id" />
|
|
|
<result column="user_id_" property="userId"/>
|
|
|
+ <result column="username_" property="userName"/>
|
|
|
<result column="course_homework_id_" property="courseHomeworkId" />
|
|
|
<result column="attachments_" property="attachments" />
|
|
|
<result column="score_" property="score" />
|
|
@@ -17,6 +18,7 @@
|
|
|
<result column="remark_" property="remark" />
|
|
|
<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="is_replied_" property="isReplied" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="is_view_" property="isView" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.ym.mec.biz.dal.dto.CourseHomeworkStudentDetailDto" id="CourseHomeworkStudentDetailDto">
|
|
@@ -50,14 +52,14 @@
|
|
|
SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
</selectKey>
|
|
|
-->
|
|
|
- INSERT INTO student_course_homework (id_,user_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_) VALUES(#{id},#{userId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ INSERT INTO student_course_homework (id_,user_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_) VALUES(#{id},#{userId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsertStudentCourseHomeworkRecord" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id_">
|
|
|
- INSERT INTO student_course_homework (user_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_)
|
|
|
+ INSERT INTO student_course_homework (user_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
|
|
|
VALUE
|
|
|
<foreach collection="list" item="homework" separator=",">
|
|
|
- (#{homework.userId},#{homework.courseHomeworkId},#{homework.attachments},#{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ (#{homework.userId},#{homework.courseHomeworkId},#{homework.attachments},#{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -92,6 +94,9 @@
|
|
|
<if test="isReplied != null">
|
|
|
is_replied_ = #{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
+ <if test="isView != null">
|
|
|
+ is_view_ = #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
</set> WHERE id_ = #{id}
|
|
|
</update>
|
|
|
|
|
@@ -205,4 +210,21 @@
|
|
|
sa.course_schedule_id_ = #{courseScheduleID}
|
|
|
AND status_ = "NORMAL"
|
|
|
</select>
|
|
|
+ <select id="findByCourseSchedule" resultMap="StudentCourseHomework">
|
|
|
+ SELECT
|
|
|
+ sch.*,
|
|
|
+ su.username_
|
|
|
+ FROM
|
|
|
+ student_course_homework sch
|
|
|
+ LEFT JOIN sys_user su ON sch.user_id_=su.id_
|
|
|
+ <where>
|
|
|
+ sch.course_homework_id_=#{courseScheduleId}
|
|
|
+ <if test="userName!=null and userName!=''">
|
|
|
+ AND su.username_ LIKE CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="findByStudentAndCourseHomewok" resultMap="StudentCourseHomework">
|
|
|
+ SELECT * FROM student_course_homework WHERE user_id_=#{userId} AND course_homework_id_=#{courseHomeworkId}
|
|
|
+ </select>
|
|
|
</mapper>
|