|  | @@ -130,7 +130,7 @@
 | 
	
		
			
				|  |  |          SELECT *
 | 
	
		
			
				|  |  |          FROM practice_group
 | 
	
		
			
				|  |  |          WHERE student_id_ = #{userId}
 | 
	
		
			
				|  |  | -          AND buy_months_ IS NULL
 | 
	
		
			
				|  |  | +          AND type_='FREE'
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 分页查询 -->
 | 
	
	
		
			
				|  | @@ -155,7 +155,7 @@
 | 
	
		
			
				|  |  |          FROM practice_group
 | 
	
		
			
				|  |  |          WHERE student_id_ = #{userId}
 | 
	
		
			
				|  |  |            AND group_status_ = 'NORMAL'
 | 
	
		
			
				|  |  | -          AND buy_months_ IS NULL
 | 
	
		
			
				|  |  | +          AND type_='FREE'
 | 
	
		
			
				|  |  |            AND create_time_ > '2020-03-25'
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="countPracticeGroupByOrgan" resultType="java.lang.Integer">
 | 
	
	
		
			
				|  | @@ -180,7 +180,7 @@
 | 
	
		
			
				|  |  |          SELECT *
 | 
	
		
			
				|  |  |          FROM practice_group
 | 
	
		
			
				|  |  |          WHERE student_id_ = #{userId}
 | 
	
		
			
				|  |  | -          AND buy_months_ IS NOT NULL
 | 
	
		
			
				|  |  | +          AND type_='CHARGE'
 | 
	
		
			
				|  |  |          ORDER BY create_time_ DESC
 | 
	
		
			
				|  |  |          LIMIT 1;
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -195,7 +195,7 @@
 | 
	
		
			
				|  |  |                   LEFT JOIN `subject` s ON pg.subject_id_ = s.id_
 | 
	
		
			
				|  |  |          WHERE student_id_ = #{userId}
 | 
	
		
			
				|  |  |            AND (pg.group_status_ = 'NORMAL' OR pg.group_status_ = 'LOCK')
 | 
	
		
			
				|  |  | -          AND pg.buy_months_ IS NOT NULL
 | 
	
		
			
				|  |  | +          AND pg.type_='CHARGE'
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findUserBuyPracticeGroupsWithDate" resultMap="PracticeCourseDto">
 | 
	
	
		
			
				|  | @@ -209,7 +209,7 @@
 | 
	
		
			
				|  |  |          WHERE student_id_ = #{userId}
 | 
	
		
			
				|  |  |            AND courses_start_date_ = #{date}
 | 
	
		
			
				|  |  |            AND group_status_ = 'LOCK'
 | 
	
		
			
				|  |  | -          AND pg.buy_months_ IS NOT NULL
 | 
	
		
			
				|  |  | +          AND pg.type_='CHARGE'
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="findUserPracticeGroup" resultMap="PracticeGroup">
 | 
	
		
			
				|  |  |          SELECT *
 | 
	
	
		
			
				|  | @@ -253,13 +253,13 @@
 | 
	
		
			
				|  |  |                  AND pg.educational_teacher_id_=#{educationalTeacherId}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="type != null and type == 1">
 | 
	
		
			
				|  |  | -                AND pg.be_renew_group_id_ IS NULL AND pg.buy_months_ IS NOT NULL
 | 
	
		
			
				|  |  | +                AND pg.be_renew_group_id_ IS NULL AND pg.type_='CHARGE'
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="type != null and type == 0">
 | 
	
		
			
				|  |  | -                AND pg.be_renew_group_id_ IS NOT NULL AND pg.buy_months_ IS NOT NULL
 | 
	
		
			
				|  |  | +                AND pg.be_renew_group_id_ IS NOT NULL AND pg.type_='CHARGE'
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="type != null and type == 2">
 | 
	
		
			
				|  |  | -                AND pg.buy_months_ IS NULL
 | 
	
		
			
				|  |  | +                AND pg.type_='FREE'
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |      </sql>
 | 
	
	
		
			
				|  | @@ -311,10 +311,10 @@
 | 
	
		
			
				|  |  |                  AND pg.courses_expire_date_ >= #{month}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test='isFree !=null and isFree=="0"'>
 | 
	
		
			
				|  |  | -                AND pg.buy_months_ > 0
 | 
	
		
			
				|  |  | +                AND pg.type_='CHARGE'
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test='isFree !=null and isFree=="1"'>
 | 
	
		
			
				|  |  | -                AND pg.buy_months_ IS NULL
 | 
	
		
			
				|  |  | +                AND pg.type_='FREE'
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test='isOver !=null and isOver=="0"'>
 | 
	
		
			
				|  |  |                  <![CDATA[AND pg.group_status_ = 'NORMAL'
 | 
	
	
		
			
				|  | @@ -401,10 +401,10 @@
 | 
	
		
			
				|  |  |          LEFT JOIN (SELECT pg.`student_id_` ,max(concat(cs.`class_date_`,' ',cs.`end_class_time_` )) lastClassDate FROM
 | 
	
		
			
				|  |  |          `practice_group` pg
 | 
	
		
			
				|  |  |          LEFT JOIN `course_schedule` cs on cs.`music_group_id_` = pg.`id_` and cs.`group_type_` = 'PRACTICE'
 | 
	
		
			
				|  |  | -        WHERE pg.`buy_months_` IS NULL AND cs.`group_type_` = 'PRACTICE'
 | 
	
		
			
				|  |  | +        WHERE pg.type_='FREE' AND cs.`group_type_` = 'PRACTICE'
 | 
	
		
			
				|  |  |          GROUP BY pg.`student_id_` ) b on a.student_id_ = b.student_id_
 | 
	
		
			
				|  |  |          left join (SELECT pg.`student_id_` ,min(pg.`create_time_`) firstBuyTime
 | 
	
		
			
				|  |  | -        FROM `practice_group` pg WHERE pg.`buy_months_` IS NOT NULL AND pg.`group_status_` in ('NORMAL','FINISH') GROUP
 | 
	
		
			
				|  |  | +        FROM `practice_group` pg WHERE pg.type_='CHARGE' AND pg.`group_status_` in ('NORMAL','FINISH') GROUP
 | 
	
		
			
				|  |  |          BY pg.`student_id_` ) c
 | 
	
		
			
				|  |  |          on a.student_id_ = c.student_id_
 | 
	
		
			
				|  |  |          left join `sys_user` u on u.`id_` = a.student_id_
 | 
	
	
		
			
				|  | @@ -436,11 +436,11 @@
 | 
	
		
			
				|  |  |          LEFT JOIN (SELECT pg.`student_id_` ,max(concat(cs.`class_date_`,' ',cs.`end_class_time_` )) lastClassDate FROM
 | 
	
		
			
				|  |  |          `practice_group` pg
 | 
	
		
			
				|  |  |          LEFT JOIN `course_schedule` cs on cs.`music_group_id_` = pg.`id_`
 | 
	
		
			
				|  |  | -        WHERE pg.`buy_months_` IS NULL AND cs.`group_type_` = 'PRACTICE'
 | 
	
		
			
				|  |  | +        WHERE pg.type_='FREE' AND cs.`group_type_` = 'PRACTICE'
 | 
	
		
			
				|  |  |          GROUP BY pg.`student_id_` ) b on a.student_id_ = b.student_id_
 | 
	
		
			
				|  |  |          left join (SELECT pg.`student_id_` ,min(pg.`create_time_`) firstBuyTime
 | 
	
		
			
				|  |  |          FROM `practice_group` pg
 | 
	
		
			
				|  |  | -        WHERE pg.`buy_months_` IS NOT NULL AND pg.`group_status_` IN ('NORMAL','FINISH') GROUP
 | 
	
		
			
				|  |  | +        WHERE pg.type_='CHARGE' AND pg.`group_status_` IN ('NORMAL','FINISH') GROUP
 | 
	
		
			
				|  |  |          BY pg.`student_id_` ) c ON a.student_id_ = c.student_id_
 | 
	
		
			
				|  |  |          LEFT JOIN (SELECT GROUP_CONCAT(DISTINCT su.real_name_) teacher_name_,pg.student_id_,GROUP_CONCAT(DISTINCT suc.real_name_) course_group_teacher_
 | 
	
		
			
				|  |  |          FROM `practice_group` pg
 | 
	
	
		
			
				|  | @@ -489,7 +489,7 @@
 | 
	
		
			
				|  |  |          su.username_ student_name_,
 | 
	
		
			
				|  |  |          o.name_ organ_name_,
 | 
	
		
			
				|  |  |          MAX(pg.courses_expire_date_) expire_date_,
 | 
	
		
			
				|  |  | -        CASE WHEN MAX(pg.buy_months_) IS NULL THEN 0 ELSE 1 END buy_practice_
 | 
	
		
			
				|  |  | +        CASE WHEN type_='FREE' THEN 0 ELSE 1 END buy_practice_
 | 
	
		
			
				|  |  |          FROM practice_group pg
 | 
	
		
			
				|  |  |          LEFT JOIN organization o on o.id_ = pg.organ_id_
 | 
	
		
			
				|  |  |          LEFT JOIN sys_user su ON su.id_ = pg.student_id_
 |