|  | @@ -392,6 +392,42 @@
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    <sql id="studentLiveGroupQueryCondition">
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            vg.audit_status_='PASS'
 | 
	
		
			
				|  |  | +            AND vg.group_status_ = 1
 | 
	
		
			
				|  |  | +            AND vg.courses_expire_date_ >= DATE_FORMAT(NOW(),'%Y%m%d')
 | 
	
		
			
				|  |  | +            AND vg.registration_start_time_ <= NOW()
 | 
	
		
			
				|  |  | +            AND vg.courses_start_date > NOW()
 | 
	
		
			
				|  |  | +            AND (select count(1) as num from student_payment_order where vg.id_ = music_group_id_ AND user_id_=#{userId} AND type_ = 'LIVE_GROUP_BUY'
 | 
	
		
			
				|  |  | +            AND status_='SUCCESS') = 0
 | 
	
		
			
				|  |  | +            <if test="expireFlag != null and expireFlag == true">
 | 
	
		
			
				|  |  | +                AND vg.payment_expire_date_ >= NOW()
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="subjectId!=null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="subjectId!=null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="categoryId!=null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(vg.vip_group_category_id_,#{categoryId})
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="classType!=null and classType.toString()=='0'.toString()">
 | 
	
		
			
				|  |  | +                AND vg.offline_classes_num_>0
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="classType!=null and classType.toString()=='1'.toString()">
 | 
	
		
			
				|  |  | +                AND vg.online_classes_num_>0
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="search != null and search != ''">
 | 
	
		
			
				|  |  | +                AND vg.name_ like concat('%',#{search},'%')
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="groupType != null and groupType != ''">
 | 
	
		
			
				|  |  | +                AND vg.group_type_ = #{groupType}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </sql>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <select id="findVipGroups" resultMap="studentVipGroup">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  |          vg.id_,
 | 
	
	
		
			
				|  | @@ -422,6 +458,35 @@
 | 
	
		
			
				|  |  |          ORDER BY vg.id_ DESC
 | 
	
		
			
				|  |  |          <include refid="global.limit"/>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="findLiveGroups" resultMap="studentVipGroup">
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +        vg.id_,
 | 
	
		
			
				|  |  | +        vg.name_,
 | 
	
		
			
				|  |  | +        vg.single_class_minutes_,
 | 
	
		
			
				|  |  | +        vg.payment_expire_date_,
 | 
	
		
			
				|  |  | +        vg.courses_expire_date_,
 | 
	
		
			
				|  |  | +        vg.courses_start_date,
 | 
	
		
			
				|  |  | +        vg.online_classes_num_,
 | 
	
		
			
				|  |  | +        vg.offline_classes_num_,
 | 
	
		
			
				|  |  | +        vg.total_price_,
 | 
	
		
			
				|  |  | +        cg.expect_student_num_,
 | 
	
		
			
				|  |  | +        cg.student_num_,
 | 
	
		
			
				|  |  | +        su.real_name_ teacher_name_,
 | 
	
		
			
				|  |  | +        su.avatar_,
 | 
	
		
			
				|  |  | +        t.introduction_,
 | 
	
		
			
				|  |  | +        vgc.name_ category_name_,vg.create_time_,
 | 
	
		
			
				|  |  | +        vg.group_type_
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +        vip_group vg
 | 
	
		
			
				|  |  | +        LEFT JOIN class_group cg ON vg.id_=cg.music_group_id_ AND cg.group_type_ = vg.group_type_
 | 
	
		
			
				|  |  | +        LEFT JOIN teacher t ON vg.user_id_=t.id_
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_user su ON vg.user_id_=su.id_
 | 
	
		
			
				|  |  | +        LEFT JOIN vip_group_category vgc ON vg.vip_group_category_id_=vgc.id_
 | 
	
		
			
				|  |  | +        <include refid="studentLiveGroupQueryCondition"/>
 | 
	
		
			
				|  |  | +        ORDER BY vg.id_ DESC
 | 
	
		
			
				|  |  | +        <include refid="global.limit"/>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |      <select id="countVipGorups" resultType="int">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  |          count(*)
 |