|
@@ -37,6 +37,61 @@
|
|
|
where t.id_ = #{id}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectAdminPage" resultType="com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo">
|
|
|
+ select
|
|
|
+ cs.id_ AS courseId,
|
|
|
+ cs.course_group_id_ AS courseGroupId,
|
|
|
+ cs.class_date_ AS classDate,
|
|
|
+ cs.start_time_ AS startTime,
|
|
|
+ cs.end_time_ AS endTime,
|
|
|
+ ch.create_time_ as decorateTime,
|
|
|
+ su2.username_ as studentName,
|
|
|
+ su2.avatar_ as studentAvatar,
|
|
|
+ su.username_ as teacherName,
|
|
|
+ su.avatar_ as teacherAvatar,
|
|
|
+ ch.create_time_ as decorateTime
|
|
|
+ from course_homework ch
|
|
|
+ left join course_schedule cs on ch.course_schedule_id_ = cs.id_
|
|
|
+ left join course_schedule_student_payment cssp on cssp.course_id_ = cs.id_
|
|
|
+ left join sys_user su on cs.teacher_id_ = su.id_
|
|
|
+ left join sys_user su2 on cssp.user_id_ = su2.id_
|
|
|
+ <where>
|
|
|
+ <if test="param.courseStatus != null">
|
|
|
+ and cs.type_ = #{param.courseType}
|
|
|
+ </if>
|
|
|
+ <if test="param.courseType != null">
|
|
|
+ and cs.status_ = #{param.courseStatus}
|
|
|
+ </if>
|
|
|
+ <if test="param.teacherId != null">
|
|
|
+ and cs.teacher_id_ = #{param.teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="param.studentId != null">
|
|
|
+ and cssp.user_id_ = #{param.studentId}
|
|
|
+ </if>
|
|
|
+ <if test="param.courseScheduleId != null ">
|
|
|
+ and cs.id_ = #{param.courseScheduleId}
|
|
|
+ </if>
|
|
|
+ <if test="param.date != null and param.date != ''">
|
|
|
+ and date_format(cs.class_date_,'%Y-%m') = #{param.date}
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ and #{param.startTime} < ch.create_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ and #{param.endTime} > ch.create_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ and (su.id_ like concat('%',#{param.search},'%')
|
|
|
+ or su.username_ like concat('%',#{param.search},'%')
|
|
|
+ or su.phone_ like concat('%',#{param.search},'%')
|
|
|
+ or su2.id_ like concat('%',#{param.search},'%')
|
|
|
+ or su2.username_ like concat('%',#{param.search},'%')
|
|
|
+ or su2.phone_ like concat('%',#{param.search},'%') )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by cs.start_time_ desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo">
|
|
|
select
|
|
|
cs.id_ AS courseId,
|
|
@@ -85,6 +140,12 @@
|
|
|
<if test="param.date != null and param.date != ''">
|
|
|
and date_format(cs.class_date_,'%Y-%m') = #{param.date}
|
|
|
</if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ and #{param.startTime} < ch.create_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ and #{param.endTime} > ch.create_time_
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by cs.start_time_ desc
|
|
|
</select>
|
|
@@ -96,6 +157,7 @@
|
|
|
,ch.title_ as title
|
|
|
,ch.content_ as content
|
|
|
,ch.attachments_ as attachments
|
|
|
+ ,ch.create_time_ as decorateTime
|
|
|
,sch.attachments_ as studentAttachments
|
|
|
,sch.teacher_replied_ as teacherReplied
|
|
|
,sch.submit_time_ as submitTime
|
|
@@ -217,4 +279,26 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectSubmitTime" resultType="com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo">
|
|
|
+ select
|
|
|
+ cs.id_ as courseId,
|
|
|
+ sch.submit_time_ as submitTime
|
|
|
+ from course_schedule cs
|
|
|
+ left join student_course_homework sch on sch.course_schedule_id_ = cs.id_
|
|
|
+ <where>
|
|
|
+ <if test="courseIdList != null and courseIdList.size() != 0">
|
|
|
+ and cs.id_ in
|
|
|
+ <foreach collection="courseIdList" separator="," close=")" open="(" item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="courseIdList != null and courseIdList.size() != 0">
|
|
|
+ order by field(cs.id_,
|
|
|
+ <foreach collection="courseIdList" separator="," close=")" open="" item="item" >
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|