|
@@ -24,6 +24,7 @@
|
|
|
<result column="audit_name_" jdbcType="VARCHAR" property="auditName" />
|
|
|
<result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="history_flag_" property="historyFlag" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="baseColumns">
|
|
@@ -49,6 +50,7 @@
|
|
|
g.update_time_ AS updateTime,
|
|
|
g.audit_id_ AS auditId,
|
|
|
g.audit_name_ AS auditName,
|
|
|
+ g.history_flag_ AS historyFlag,
|
|
|
</sql>
|
|
|
<sql id="recordColumns">
|
|
|
g.id_ AS id,
|
|
@@ -70,6 +72,7 @@
|
|
|
g.update_time_ AS updateTime,
|
|
|
g.audit_id_ AS auditId,
|
|
|
g.audit_name_ AS auditName,
|
|
|
+ g.history_flag_ AS historyFlag,
|
|
|
</sql>
|
|
|
|
|
|
<update id="updateGroup" parameterType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupUpVo">
|
|
@@ -125,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>
|
|
@@ -168,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>
|
|
@@ -214,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>
|
|
@@ -287,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
|
|
@@ -318,18 +324,77 @@
|
|
|
</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.video_group_id_ as videoGroupId,
|
|
|
+ r.group_id_ as groupId,
|
|
|
+ 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_
|
|
|
- LEFT JOIN video_lesson_auth_record r ON g.id_=r.video_group_id_
|
|
|
<where>
|
|
|
+ <if test="null != param.groupId">
|
|
|
+ AND r.group_id_ = #{param.groupId}
|
|
|
+ </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.video_group_id_ as videoGroupId,
|
|
|
+ r.group_id_ as groupId,
|
|
|
+ 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_
|
|
|
+ <where>
|
|
|
+ and r.audit_status_ != 'DOING'
|
|
|
+ <if test="null != param.groupId">
|
|
|
+ AND r.group_id_ = #{param.groupId}
|
|
|
+ </if>
|
|
|
<if test="null != param.search and '' != param.search">
|
|
|
AND (
|
|
|
g.id_ LIKE CONCAT('%', #{param.search}, '%') OR
|
|
@@ -360,11 +425,50 @@
|
|
|
</where>
|
|
|
ORDER BY g.create_time_ DESC
|
|
|
</select>
|
|
|
- <select id="selectGroupById" resultType="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup"
|
|
|
+
|
|
|
+ <select id="authGroupDetil" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonAuthGroup">
|
|
|
+ SELECT
|
|
|
+ <include refid="recordColumns"/>
|
|
|
+ r.video_group_id_ as videoGroupId,
|
|
|
+ r.group_id_ as groupId,
|
|
|
+ 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_
|
|
|
+ where r.video_group_id_ = #{videoGroupId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="lastAuthGroupDetil" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonAuthGroup">
|
|
|
+ SELECT
|
|
|
+ <include refid="recordColumns"/>
|
|
|
+ r.video_group_id_ as videoGroupId,
|
|
|
+ r.group_id_ as groupId,
|
|
|
+ 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_
|
|
|
+ where r.video_group_id_ != #{videoGroupId} and r.group_id_ = #{groupId}
|
|
|
+ order by r.id_ desc limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <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}
|