|  | @@ -15,11 +15,15 @@
 | 
	
		
			
				|  |  |  		<result column="lesson_tag_" jdbcType="VARCHAR" property="lessonTag" />
 | 
	
		
			
				|  |  |  		<result column="top_flag_" jdbcType="TINYINT" property="topFlag" />
 | 
	
		
			
				|  |  |  		<result column="hot_flag_" jdbcType="TINYINT" property="hotFlag" />
 | 
	
		
			
				|  |  | +		<result column="shelves_flag_" jdbcType="TINYINT" property="shelvesFlag" />
 | 
	
		
			
				|  |  | +		<result column="shelves_time_" property="shelvesTime" />
 | 
	
		
			
				|  |  | +		<result column="shelves_reason_" property="shelvesReason" />
 | 
	
		
			
				|  |  | +		<result column="shelves_id_" property="shelvesId" />
 | 
	
		
			
				|  |  |  		<result column="audit_status_" jdbcType="TINYINT" property="auditStatus" />
 | 
	
		
			
				|  |  | -		<result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
 | 
	
		
			
				|  |  | -		<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
 | 
	
		
			
				|  |  |  		<result column="audit_id_" jdbcType="INTEGER" property="auditId" />
 | 
	
		
			
				|  |  |  		<result column="audit_name_" jdbcType="VARCHAR" property="auditName" />
 | 
	
		
			
				|  |  | +		<result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
 | 
	
		
			
				|  |  | +		<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
 | 
	
		
			
				|  |  |  	</resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<sql id="baseColumns">
 | 
	
	
		
			
				|  | @@ -35,7 +39,11 @@
 | 
	
		
			
				|  |  |  		g.lesson_tag_ AS lessonTag,
 | 
	
		
			
				|  |  |  		g.top_flag_ AS topFlag,
 | 
	
		
			
				|  |  |  		g.hot_flag_ AS hotFlag,
 | 
	
		
			
				|  |  | +		g.shelves_flag_ AS shelvesFlag,
 | 
	
		
			
				|  |  | +		g.shelves_time_ as shelvesTime,
 | 
	
		
			
				|  |  | +		g.shelves_reason_ as shelvesReason,
 | 
	
		
			
				|  |  |  		g.audit_status_ AS auditStatus,
 | 
	
		
			
				|  |  | +		g.shelves_id_ as shelvesId,
 | 
	
		
			
				|  |  |  		g.create_time_ AS createTime,
 | 
	
		
			
				|  |  |  		g.update_time_ AS updateTime,
 | 
	
		
			
				|  |  |  		g.audit_id_ AS auditId,
 | 
	
	
		
			
				|  | @@ -54,6 +62,9 @@
 | 
	
		
			
				|  |  |  		g.lesson_tag_ AS lessonTag,
 | 
	
		
			
				|  |  |  		g.top_flag_ AS topFlag,
 | 
	
		
			
				|  |  |  		g.hot_flag_ AS hotFlag,
 | 
	
		
			
				|  |  | +		g.shelves_flag_ AS shelvesFlag,
 | 
	
		
			
				|  |  | +		g.shelves_time_ as shelvesTime,
 | 
	
		
			
				|  |  | +		g.shelves_reason_ as shelvesReason,
 | 
	
		
			
				|  |  |  		g.create_time_ AS createTime,
 | 
	
		
			
				|  |  |  		g.update_time_ AS updateTime,
 | 
	
		
			
				|  |  |  		g.audit_id_ AS auditId,
 | 
	
	
		
			
				|  | @@ -72,6 +83,10 @@
 | 
	
		
			
				|  |  |  			<if test="lessonTag !=null and lessonTag !=''">lesson_tag_ = #{lessonTag},</if>
 | 
	
		
			
				|  |  |  			<if test="topFlag !=null">top_flag_ = #{topFlag},</if>
 | 
	
		
			
				|  |  |  			<if test="hotFlag !=null">hot_flag_ = #{hotFlag},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesFlag !=null">shelves_flag_ = #{shelvesFlag},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesTime !=null">shelves_time_ = #{shelvesTime},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesReason !=null and shelvesReason !=''">shelves_reason_ = #{shelvesReason},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesId !=null">shelves_id_ = #{shelvesId},</if>
 | 
	
		
			
				|  |  |  			<if test="auditStatus !=null">audit_status_ = #{auditStatus},</if>
 | 
	
		
			
				|  |  |  			update_time_ = SYSDATE(),
 | 
	
		
			
				|  |  |  			lesson_count_ = (SELECT COUNT(1) FROM video_lesson_group_detail WHERE video_lesson_group_id_ = #{id})
 | 
	
	
		
			
				|  | @@ -89,6 +104,18 @@
 | 
	
		
			
				|  |  |  		</set>
 | 
	
		
			
				|  |  |  		WHERE id_ = #{id}
 | 
	
		
			
				|  |  |  	</update>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	<update id="updateShelves">
 | 
	
		
			
				|  |  | +		UPDATE video_lesson_group
 | 
	
		
			
				|  |  | +		<set>
 | 
	
		
			
				|  |  | +			<if test="shelvesFlag !=null">shelves_flag_ = #{shelvesFlag},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesTime !=null">shelves_time_ = #{shelvesTime},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesReason !=null and shelvesReason!=''">shelves_reason_ = #{shelvesReason},</if>
 | 
	
		
			
				|  |  | +			<if test="shelvesId !=null">shelves_id_ = #{shelvesId},</if>
 | 
	
		
			
				|  |  | +			update_time_ = SYSDATE()
 | 
	
		
			
				|  |  | +		</set>
 | 
	
		
			
				|  |  | +		WHERE id_ = #{id}
 | 
	
		
			
				|  |  | +	</update>
 | 
	
		
			
				|  |  |  	<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupVo">
 | 
	
		
			
				|  |  |  		SELECT
 | 
	
		
			
				|  |  |  			<include refid="baseColumns"/>
 | 
	
	
		
			
				|  | @@ -101,6 +128,9 @@
 | 
	
		
			
				|  |  |  		LEFT JOIN sys_user s ON g.teacher_id_ = s.id_
 | 
	
		
			
				|  |  |  		LEFT JOIN `subject` b ON g.lesson_subject_=b.id_
 | 
	
		
			
				|  |  |  		<where>
 | 
	
		
			
				|  |  | +			<if test="param.shelvesFlag !=null">
 | 
	
		
			
				|  |  | +				AND g.shelves_flag_ = #{param.shelvesFlag}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  |  			<if test="param.auditStatus !=null">
 | 
	
		
			
				|  |  |  				AND g.audit_status_ = #{param.auditStatus}
 | 
	
		
			
				|  |  |  			</if>
 | 
	
	
		
			
				|  | @@ -157,6 +187,9 @@
 | 
	
		
			
				|  |  |  			<if test="null != param.lessonSubject and '' != param.lessonSubject">
 | 
	
		
			
				|  |  |  				AND g.lesson_subject_ = #{param.lessonSubject}
 | 
	
		
			
				|  |  |  			</if>
 | 
	
		
			
				|  |  | +			<if test="param.shelvesFlag !=null">
 | 
	
		
			
				|  |  | +				AND g.shelves_flag_ = #{param.shelvesFlag}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  |  			<if test="param.auditStatus !=null">
 | 
	
		
			
				|  |  |  				AND g.audit_status_ = #{param.auditStatus}
 | 
	
		
			
				|  |  |  			</if>
 | 
	
	
		
			
				|  | @@ -198,6 +231,9 @@
 | 
	
		
			
				|  |  |  			<if test="param.auditStatus !=null">
 | 
	
		
			
				|  |  |  				AND g.audit_status_ = #{param.auditStatus}
 | 
	
		
			
				|  |  |  			</if>
 | 
	
		
			
				|  |  | +			<if test="param.shelvesFlag !=null">
 | 
	
		
			
				|  |  | +				AND g.shelves_flag_ = #{param.shelvesFlag}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  |  		</where>
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<select id="selectPurchaseStudent" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonPurchaseVo">
 | 
	
	
		
			
				|  | @@ -259,6 +295,9 @@
 | 
	
		
			
				|  |  |  				g.lesson_name_ LIKE CONCAT('%', #{param.search}, '%')
 | 
	
		
			
				|  |  |  				)
 | 
	
		
			
				|  |  |  			</if>
 | 
	
		
			
				|  |  | +			<if test="param.shelvesFlag !=null">
 | 
	
		
			
				|  |  | +				AND g.shelves_flag_ = #{param.shelvesFlag}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  |  			<if test="param.auditStatus !=null">
 | 
	
		
			
				|  |  |  				AND g.audit_status_ = #{param.auditStatus}
 | 
	
		
			
				|  |  |  			</if>
 | 
	
	
		
			
				|  | @@ -304,6 +343,9 @@
 | 
	
		
			
				|  |  |  			<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>
 | 
	
	
		
			
				|  | @@ -344,6 +386,7 @@
 | 
	
		
			
				|  |  |  			COUNT(1) AS payCount
 | 
	
		
			
				|  |  |  		FROM video_lesson_purchase_record r
 | 
	
		
			
				|  |  |  		LEFT JOIN video_lesson_group g ON r.video_lesson_group_id_=g.id_
 | 
	
		
			
				|  |  | +		where g.shelves_flag_ = 1 and g.audit_status_ = 'PASS'
 | 
	
		
			
				|  |  |  		GROUP BY r.video_lesson_group_id_
 | 
	
		
			
				|  |  |  		ORDER BY payCount DESC
 | 
	
		
			
				|  |  |  		LIMIT 5
 |