|  | @@ -189,6 +189,9 @@
 | 
											
												
													
														|  |              <if test="educationalTeacherId!=null">
 |  |              <if test="educationalTeacherId!=null">
 | 
											
												
													
														|  |                  AND vg.educational_teacher_id_=#{educationalTeacherId}
 |  |                  AND vg.educational_teacher_id_=#{educationalTeacherId}
 | 
											
												
													
														|  |              </if>
 |  |              </if>
 | 
											
												
													
														|  | 
 |  | +            <if test="userId!=null">
 | 
											
												
													
														|  | 
 |  | +                AND cssp.user_id_ = #{userId}
 | 
											
												
													
														|  | 
 |  | +            </if>
 | 
											
												
													
														|  |          </where>
 |  |          </where>
 | 
											
												
													
														|  |      </sql>
 |  |      </sql>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -201,17 +204,21 @@
 | 
											
												
													
														|  |              vip_group vg
 |  |              vip_group vg
 | 
											
												
													
														|  |              LEFT JOIN sys_user su ON vg.user_id_=su.id_
 |  |              LEFT JOIN sys_user su ON vg.user_id_=su.id_
 | 
											
												
													
														|  |              LEFT JOIN vip_group_activity vga ON vg.vip_group_activity_id_=vga.id_
 |  |              LEFT JOIN vip_group_activity vga ON vg.vip_group_activity_id_=vga.id_
 | 
											
												
													
														|  | 
 |  | +            left join course_schedule_student_payment cssp on cssp.music_group_id_ = vg.id_ and cssp.group_type_ = 'VIP'
 | 
											
												
													
														|  |          <include refid="vipGroupQueryCondition"/>
 |  |          <include refid="vipGroupQueryCondition"/>
 | 
											
												
													
														|  | 
 |  | +        group by vg.id_
 | 
											
												
													
														|  |          ORDER BY vg.id_ DESC
 |  |          ORDER BY vg.id_ DESC
 | 
											
												
													
														|  |          <include refid="global.limit"/>
 |  |          <include refid="global.limit"/>
 | 
											
												
													
														|  |  	</select>
 |  |  	</select>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      <select id="countVipGroupByOrgan" resultType="int">
 |  |      <select id="countVipGroupByOrgan" resultType="int">
 | 
											
												
													
														|  |          SELECT
 |  |          SELECT
 | 
											
												
													
														|  | -        count(*)
 |  | 
 | 
											
												
													
														|  | 
 |  | +        count(distinct vg.id_)
 | 
											
												
													
														|  |          FROM
 |  |          FROM
 | 
											
												
													
														|  |          vip_group vg
 |  |          vip_group vg
 | 
											
												
													
														|  | 
 |  | +        left join course_schedule_student_payment cssp on cssp.music_group_id_ = vg.id_ and cssp.group_type_ = 'VIP'
 | 
											
												
													
														|  |          <include refid="vipGroupQueryCondition"/>
 |  |          <include refid="vipGroupQueryCondition"/>
 | 
											
												
													
														|  | 
 |  | +        GROUP BY vg.id_
 | 
											
												
													
														|  |      </select>
 |  |      </select>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      <!-- 向数据库增加一条记录 -->
 |  |      <!-- 向数据库增加一条记录 -->
 |