|
@@ -19,6 +19,7 @@
|
|
|
<result column="mix_student_num_" jdbcType="INTEGER" property="mixStudentNum"/>
|
|
|
<result column="max_student_num_" jdbcType="INTEGER" property="maxStudentNum"/>
|
|
|
<result column="course_start_time_" jdbcType="TIMESTAMP" property="courseStartTime"/>
|
|
|
+ <result column="course_end_time_" jdbcType="TIMESTAMP" property="courseEndTime"/>
|
|
|
<result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
|
|
|
<result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
|
|
|
<result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
|
|
@@ -34,20 +35,21 @@
|
|
|
, type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_,
|
|
|
complete_course_num_, course_introduce_, course_price_, status_, sales_start_date_,
|
|
|
sales_end_date_, background_pic_, mix_student_num_,max_student_num_,pre_student_num_, im_group_id_,
|
|
|
- course_start_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_
|
|
|
+ course_start_time_,course_end_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_
|
|
|
</sql>
|
|
|
|
|
|
<insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
|
|
|
parameterType="com.yonge.cooleshow.biz.dal.entity.CourseGroup">
|
|
|
insert into course_group(type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_,
|
|
|
complete_course_num_, course_introduce_, course_price_, status_, sales_start_date_, sales_end_date_, background_pic_,
|
|
|
- mix_student_num_,max_student_num_,pre_student_num_,im_group_id_, course_start_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_)
|
|
|
+ mix_student_num_,max_student_num_,pre_student_num_,im_group_id_, course_start_time_, course_end_time_,
|
|
|
+ created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.type}, #{entity.teacherId}, #{entity.name}, #{entity.subjectId}, #{entity.singleCourseMinutes},
|
|
|
#{entity.courseNum}, #{entity.completeCourseNum}, #{entity.courseIntroduce}, #{entity.coursePrice}, #{entity.status},
|
|
|
#{entity.salesStartDate}, #{entity.salesEndDate}, #{entity.backgroundPic}, #{entity.mixStudentNum},#{entity.maxStudentNum},
|
|
|
- #{entity.preStudentNum},#{entity.imGroupId},#{entity.courseStartTime}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
|
|
|
+ #{entity.preStudentNum},#{entity.imGroupId},#{entity.courseStartTime},#{entity.courseEndTime}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
|
|
|
#{entity.updatedTime},#{entity.reason},#{entity.coursePlan})
|
|
|
</foreach>
|
|
|
</insert>
|
|
@@ -1127,7 +1129,12 @@
|
|
|
where id_ = #{groupId} and lock_num_ + #{num} <= max_student_num_ and lock_num_ + #{num} >= 0
|
|
|
</update>
|
|
|
<update id="updateCourseStartTime">
|
|
|
- update course_group set course_start_time_ =
|
|
|
- (select MIN(start_time_) from course_schedule where course_group_id_ = #{groupId}) WHERE id_ = #{groupId}
|
|
|
+ update course_group cg
|
|
|
+ left join (
|
|
|
+ select course_group_id_,MIN(start_time_) start_time_,MAX(end_time_) end_time_ from course_schedule
|
|
|
+ where course_group_id_ = #{groupId}
|
|
|
+ group by course_group_id_) c ON c.course_group_id_ = cg.id_
|
|
|
+ set cg.course_start_time_ = c.start_time_,cg.course_end_time_ = c.end_time_
|
|
|
+ where c.course_group_id_ = cg.id_ AND cg.id_ = #{groupId}
|
|
|
</update>
|
|
|
</mapper>
|