|
@@ -128,6 +128,7 @@
|
|
|
LEFT JOIN sys_user s ON g.teacher_id_ = s.id_
|
|
|
LEFT JOIN `subject` b ON g.lesson_subject_=b.id_
|
|
|
<where>
|
|
|
+ and g.history_flag_ = 0
|
|
|
<if test="param.shelvesFlag !=null">
|
|
|
AND g.shelves_flag_ = #{param.shelvesFlag}
|
|
|
</if>
|
|
@@ -171,6 +172,7 @@
|
|
|
LEFT JOIN sys_user s ON g.teacher_id_ = s.id_
|
|
|
LEFT JOIN subject j ON g.lesson_subject_ = j.id_
|
|
|
<where>
|
|
|
+ AND g.history_flag_ = 0
|
|
|
<if test="param.userId !=null">
|
|
|
AND p.student_id_ = #{param.userId}
|
|
|
</if>
|
|
@@ -217,6 +219,7 @@
|
|
|
FROM video_lesson_group g
|
|
|
LEFT JOIN subject j ON g.lesson_subject_ = j.id_
|
|
|
<where>
|
|
|
+ AND g.history_flag_ = 0
|
|
|
<if test="param.userId !=null">
|
|
|
AND g.teacher_id_ = #{param.userId}
|
|
|
</if>
|
|
@@ -290,7 +293,7 @@
|
|
|
LEFT JOIN sys_user u ON g.teacher_id_=u.id_
|
|
|
LEFT JOIN `subject` s ON g.lesson_subject_ = s.id_
|
|
|
<where>
|
|
|
- u.del_flag_ = 0
|
|
|
+ AND g.history_flag_ = 0 and u.del_flag_ = 0
|
|
|
<if test="null != param.search and '' != param.search">
|
|
|
AND (
|
|
|
u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
@@ -321,18 +324,74 @@
|
|
|
</select>
|
|
|
<select id="queryGroupList" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonAuthGroup">
|
|
|
SELECT
|
|
|
- <include refid="recordColumns"/>
|
|
|
- r.audit_status_ AS auditStatus,
|
|
|
- r.remarks as remarks,
|
|
|
- s.name_ AS subjectName,
|
|
|
- t.username_ AS teacherName,
|
|
|
- t.real_name_ AS realName,
|
|
|
- t.phone_ AS teacherPhone
|
|
|
- FROM video_lesson_group g
|
|
|
+ <include refid="recordColumns"/>
|
|
|
+ r.group_id_ as videoGroupId,
|
|
|
+ r.audit_status_ AS auditStatus,
|
|
|
+ r.remarks as remarks,
|
|
|
+ s.name_ AS subjectName,
|
|
|
+ t.username_ AS teacherName,
|
|
|
+ t.real_name_ AS realName,
|
|
|
+ t.phone_ AS teacherPhone
|
|
|
+ FROM (
|
|
|
+ select group_id_,max(id_) as id_ from video_lesson_auth_record group by group_id_
|
|
|
+ ) a
|
|
|
+ LEFT JOIN video_lesson_auth_record r ON a.id_ = r.id_
|
|
|
+ LEFT JOIN video_lesson_group g ON g.id_=r.video_group_id_
|
|
|
+ LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
|
|
|
+ LEFT JOIN sys_user t ON g.teacher_id_=t.id_
|
|
|
+ <where>
|
|
|
+ <if test="null != param.videoGroupId">
|
|
|
+ AND r.group_id_ = #{param.videoGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="null != param.search and '' != param.search">
|
|
|
+ AND (
|
|
|
+ g.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ g.lesson_name_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ t.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ t.username_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
|
+ t.phone_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.auditStatus !=null and param.auditStatus !=''">
|
|
|
+ AND r.audit_status_ = #{param.auditStatus}
|
|
|
+ </if>
|
|
|
+ <if test="param.shelvesFlag !=null">
|
|
|
+ AND g.shelves_flag_ = #{param.shelvesFlag}
|
|
|
+ </if>
|
|
|
+ <if test="param.subjectId !=null">
|
|
|
+ AND g.lesson_subject_ = #{param.subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="param.auditName !=null and param.auditName !=''">
|
|
|
+ AND r.audit_name_ LIKE CONCAT('%', #{param.auditName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime !=null">
|
|
|
+ <![CDATA[AND g.create_time_ >= #{param.startTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime !=null">
|
|
|
+ <![CDATA[AND g.create_time_ <= #{param.endTime} ]]>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY g.create_time_
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryGroupHistoryList" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonAuthGroup">
|
|
|
+ SELECT
|
|
|
+ <include refid="recordColumns"/>
|
|
|
+ r.group_id_ as videoGroupId,
|
|
|
+ r.audit_status_ AS auditStatus,
|
|
|
+ r.remarks as remarks,
|
|
|
+ s.name_ AS subjectName,
|
|
|
+ t.username_ AS teacherName,
|
|
|
+ t.real_name_ AS realName,
|
|
|
+ t.phone_ AS teacherPhone
|
|
|
+ FROM video_lesson_auth_record r
|
|
|
+ LEFT JOIN video_lesson_group g ON g.id_=r.video_group_id_
|
|
|
LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
|
|
|
LEFT JOIN sys_user t ON g.teacher_id_=t.id_
|
|
|
- LEFT JOIN video_lesson_auth_record r ON g.id_=r.video_group_id_
|
|
|
<where>
|
|
|
+ <if test="null != param.videoGroupId">
|
|
|
+ AND r.group_id_ = #{param.videoGroupId}
|
|
|
+ </if>
|
|
|
<if test="null != param.search and '' != param.search">
|
|
|
AND (
|
|
|
g.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
@@ -363,11 +422,12 @@
|
|
|
</where>
|
|
|
ORDER BY g.create_time_ DESC
|
|
|
</select>
|
|
|
- <select id="selectGroupById" resultType="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup"
|
|
|
+
|
|
|
+ <select id="selectGroupById" resultType="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup"
|
|
|
parameterType="java.lang.Long">
|
|
|
SELECT
|
|
|
- <include refid="baseColumns"/>
|
|
|
- s.name_ AS lessonSubjectName
|
|
|
+ <include refid="baseColumns"/>
|
|
|
+ s.name_ AS lessonSubjectName
|
|
|
FROM video_lesson_group g
|
|
|
LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
|
|
|
WHERE g.id_=#{groupId}
|