|
@@ -11,6 +11,7 @@
|
|
|
<result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="course_schedule_id_" property="courseScheduleId" />
|
|
|
<result column="attachments_" property="attachments" />
|
|
|
+ <result column="title_" property="title" />
|
|
|
<result column="content_" property="content" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
@@ -24,6 +25,7 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.dto.CourseHomeworkListDto" id="CourseHomeworkDto">
|
|
|
<result column="id_" property="id" />
|
|
|
<result column="course_schedule_id_" property="courseScheduleId" />
|
|
|
+ <result column="title_" property="title" />
|
|
|
<result column="content_" property="content" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="start_class_time_" property="startClassTime" />
|
|
@@ -56,12 +58,11 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseHomework" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- INSERT INTO course_homework (id_,group_type_,course_schedule_id_,attachments_,content_,create_time_,update_time_,music_group_id_,class_group_id_,completed_num_,expect_num_,expiry_date_) VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseScheduleId},#{attachments},#{content},now(),now(),#{musicGroupId},#{classGroupId},#{completedNum},#{expectNum},#{expiryDate})
|
|
|
+ INSERT INTO course_homework (group_type_,course_schedule_id_,attachments_,
|
|
|
+ title,content_,create_time_,update_time_,music_group_id_,class_group_id_,completed_num_,expect_num_,expiry_date_)
|
|
|
+ VALUES(#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{courseScheduleId},#{attachments},#{title},#{content},now(),now(),#{musicGroupId},
|
|
|
+ #{classGroupId},#{completedNum},#{expectNum},#{expiryDate})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -71,9 +72,6 @@
|
|
|
<if test="attachments != null">
|
|
|
attachments_ = #{attachments},
|
|
|
</if>
|
|
|
- <if test="id != null">
|
|
|
- id_ = #{id},
|
|
|
- </if>
|
|
|
<if test="classGroupId != null">
|
|
|
class_group_id_ = #{classGroupId},
|
|
|
</if>
|
|
@@ -90,6 +88,9 @@
|
|
|
<if test="expectNum != null">
|
|
|
expect_num_ = #{expectNum},
|
|
|
</if>
|
|
|
+ <if test="title != null">
|
|
|
+ title_ = #{title},
|
|
|
+ </if>
|
|
|
<if test="content != null">
|
|
|
content_ = #{content},
|
|
|
</if>
|
|
@@ -158,6 +159,7 @@
|
|
|
<resultMap id="teacherHomeworkListDto" type="com.ym.mec.biz.dal.dto.TeacherHomeworkListDto">
|
|
|
<result property="courseScheduleId" column="course_homework_id_"/>
|
|
|
<result property="content" column="content_"/>
|
|
|
+ <result property="title" column="title_"/>
|
|
|
<result property="expectNum" column="expect_num_"/>
|
|
|
<result property="completedNum" column="completed_num_"/>
|
|
|
<result property="courseScheduleName" column="course_schedule_name_"/>
|
|
@@ -176,6 +178,7 @@
|
|
|
SELECT
|
|
|
cs.id_ course_homework_id_,
|
|
|
ch.content_,
|
|
|
+ ch.title_,
|
|
|
ch.create_time_,
|
|
|
DATE_FORMAT(cs.class_date_,'%Y-%m-%d') 'day_',
|
|
|
CONCAT( class_date_, ' ', start_class_time_ ) start_class_time_,
|