|  | @@ -2,25 +2,24 @@
 | 
											
												
													
														|  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
 |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
 | 
											
												
													
														|  |      "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 |  |      "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
											
												
													
														|  |  <mapper namespace="com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDao">
 |  |  <mapper namespace="com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDao">
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup">
 |  |  	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup">
 | 
											
												
													
														|  | -	     <id column="id_" jdbcType="BIGINT" property="id" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_name_" jdbcType="VARCHAR" property="lessonName" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_subject_" jdbcType="VARCHAR" property="lessonSubject" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_desc_" jdbcType="VARCHAR" property="lessonDesc" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_price_" jdbcType="INTEGER" property="lessonPrice" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_cover_url_" jdbcType="VARCHAR" property="lessonCoverUrl" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="teacher_id_" jdbcType="BIGINT" property="teacherId" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="lesson_count_" jdbcType="INTEGER" property="lessonCount" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="sort_number_" jdbcType="INTEGER" property="sortNumber" />
 |  | 
 | 
											
												
													
														|  | -		 <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="audit_status_" jdbcType="TINYINT" property="auditStatus" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
 |  | 
 | 
											
												
													
														|  | -		 <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
 |  | 
 | 
											
												
													
														|  | 
 |  | +		<id column="id_" jdbcType="BIGINT" property="id" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_name_" jdbcType="VARCHAR" property="lessonName" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_subject_" jdbcType="VARCHAR" property="lessonSubject" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_desc_" jdbcType="VARCHAR" property="lessonDesc" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_price_" jdbcType="INTEGER" property="lessonPrice" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_cover_url_" jdbcType="VARCHAR" property="lessonCoverUrl" />
 | 
											
												
													
														|  | 
 |  | +		<result column="teacher_id_" jdbcType="BIGINT" property="teacherId" />
 | 
											
												
													
														|  | 
 |  | +		<result column="lesson_count_" jdbcType="INTEGER" property="lessonCount" />
 | 
											
												
													
														|  | 
 |  | +		<result column="sort_number_" jdbcType="INTEGER" property="sortNumber" />
 | 
											
												
													
														|  | 
 |  | +		<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="audit_status_" jdbcType="TINYINT" property="auditStatus" />
 | 
											
												
													
														|  | 
 |  | +		<result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
 | 
											
												
													
														|  | 
 |  | +		<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
 | 
											
												
													
														|  |  	</resultMap>
 |  |  	</resultMap>
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	<sql id="baseColumns">
 |  |  	<sql id="baseColumns">
 | 
											
												
													
														|  |  		g.id_ AS id,
 |  |  		g.id_ AS id,
 | 
											
												
													
														|  |  		g.lesson_name_ AS lessonName,
 |  |  		g.lesson_name_ AS lessonName,
 | 
											
										
											
												
													
														|  | @@ -38,28 +37,26 @@
 | 
											
												
													
														|  |  		g.create_time_ AS createTime,
 |  |  		g.create_time_ AS createTime,
 | 
											
												
													
														|  |  		g.update_time_ AS updateTime
 |  |  		g.update_time_ AS updateTime
 | 
											
												
													
														|  |  	</sql>
 |  |  	</sql>
 | 
											
												
													
														|  | -	<sql id="groupDetail">
 |  | 
 | 
											
												
													
														|  | -		id_ AS id,
 |  | 
 | 
											
												
													
														|  | -		video_lesson_group_id_ AS videoLessonGroupId,
 |  | 
 | 
											
												
													
														|  | -		video_title_ AS videoTitle,
 |  | 
 | 
											
												
													
														|  | -		video_content_ AS videoContent,
 |  | 
 | 
											
												
													
														|  | -		video_url_ AS videoUrl,
 |  | 
 | 
											
												
													
														|  | -		cover_url_ AS coverUrl,
 |  | 
 | 
											
												
													
														|  | -		charge_flag_ AS chargeFlag,
 |  | 
 | 
											
												
													
														|  | -		sort_number_ AS sortNumber,
 |  | 
 | 
											
												
													
														|  | -		teacher_id_ AS teacherId,
 |  | 
 | 
											
												
													
														|  | -		create_time_ AS createTime,
 |  | 
 | 
											
												
													
														|  | -		update_by_ AS updateBy,
 |  | 
 | 
											
												
													
														|  | -		update_time_ AS updateTime
 |  | 
 | 
											
												
													
														|  | -	</sql>
 |  | 
 | 
											
												
													
														|  | -	<sql id="userDetail">
 |  | 
 | 
											
												
													
														|  | -		username_ AS username,
 |  | 
 | 
											
												
													
														|  | -		avatar_ AS avatar,
 |  | 
 | 
											
												
													
														|  | -		gender_ AS gender,
 |  | 
 | 
											
												
													
														|  | -		create_time_ AS createTime
 |  | 
 | 
											
												
													
														|  | -	</sql>
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupVo">
 |  | 
 | 
											
												
													
														|  | 
 |  | +	<update id="updateGroup" parameterType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupUpVo">
 | 
											
												
													
														|  | 
 |  | +		UPDATE video_lesson_group
 | 
											
												
													
														|  | 
 |  | +		<set>
 | 
											
												
													
														|  | 
 |  | +			<if test="lessonName !=null and lessonName !=''">lesson_name_ = #{lessonName},</if>
 | 
											
												
													
														|  | 
 |  | +			<if test="lessonSubject !=null and lessonSubject !=''">lesson_subject_ = #{lessonSubject},</if>
 | 
											
												
													
														|  | 
 |  | +			<if test="lessonDesc !=null and lessonDesc !=''">lesson_desc_ = #{lessonDesc},</if>
 | 
											
												
													
														|  | 
 |  | +			<if test="lessonPrice !=null and lessonPrice !=''">lesson_price_ = #{lessonPrice},</if>
 | 
											
												
													
														|  | 
 |  | +			<if test="lessonCoverUrl !=null and lessonCoverUrl !=''">lesson_cover_url_ = #{lessonCoverUrl},</if>
 | 
											
												
													
														|  | 
 |  | +			<if test="sortNumber !=null">sort_number_ = #{sortNumber},</if>
 | 
											
												
													
														|  | 
 |  | +			<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="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})
 | 
											
												
													
														|  | 
 |  | +		</set>
 | 
											
												
													
														|  | 
 |  | +		WHERE id_ = #{id}
 | 
											
												
													
														|  | 
 |  | +	</update>
 | 
											
												
													
														|  | 
 |  | +	<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupVo">
 | 
											
												
													
														|  |  		SELECT
 |  |  		SELECT
 | 
											
												
													
														|  |  			<include refid="baseColumns"/>,
 |  |  			<include refid="baseColumns"/>,
 | 
											
												
													
														|  |  			s.username_ AS username,
 |  |  			s.username_ AS username,
 | 
											
										
											
												
													
														|  | @@ -73,21 +70,4 @@
 | 
											
												
													
														|  |  			</if>
 |  |  			</if>
 | 
											
												
													
														|  |  		</where>
 |  |  		</where>
 | 
											
												
													
														|  |  	</select>
 |  |  	</select>
 | 
											
												
													
														|  | -	<select id="selectDetail" resultType="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail"
 |  | 
 | 
											
												
													
														|  | -			parameterType="java.lang.Long">
 |  | 
 | 
											
												
													
														|  | -		SELECT
 |  | 
 | 
											
												
													
														|  | -			<include refid="groupDetail"/>
 |  | 
 | 
											
												
													
														|  | -		FROM video_lesson_group_detail
 |  | 
 | 
											
												
													
														|  | -		WHERE video_lesson_group_id_ = #{id}
 |  | 
 | 
											
												
													
														|  | -	</select>
 |  | 
 | 
											
												
													
														|  | -	<select id="selectStudent" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonPurchaseStudent"
 |  | 
 | 
											
												
													
														|  | -			parameterType="java.lang.Long">
 |  | 
 | 
											
												
													
														|  | -		SELECT
 |  | 
 | 
											
												
													
														|  | -			<include refid="userDetail"/>
 |  | 
 | 
											
												
													
														|  | -		FROM sys_user
 |  | 
 | 
											
												
													
														|  | -		WHERE id_ IN
 |  | 
 | 
											
												
													
														|  | -			  (SELECT student_id_
 |  | 
 | 
											
												
													
														|  | -			   FROM video_lesson_purchase_record
 |  | 
 | 
											
												
													
														|  | -			   WHERE video_lesson_group_id_ = #{id})
 |  | 
 | 
											
												
													
														|  | -	</select>
 |  | 
 | 
											
												
													
														|  |  </mapper>
 |  |  </mapper>
 |