Explorar el Código

Merge remote-tracking branch 'origin/master'

Joburgess hace 5 años
padre
commit
09cbde9280

+ 6 - 5
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -272,7 +272,7 @@
 
     <sql id="practiceGroupReviewsQueryCondition">
         <where>
-            pg.group_status_='NORMAL'
+            pg.group_status_ != 'CANCEL' AND pg.group_status_ != 'LOCK'
             <if test="month != null">
                 AND DATE_FORMAT(cse.create_time_, '%Y-%m') = #{month}
             </if>
@@ -295,11 +295,11 @@
                 AND pg.buy_months_ IS NULL
             </if>
             <if test='isOver !=null and isOver=="0"'>
-                <![CDATA[AND pg.courses_expire_date_ > NOW()
+                <![CDATA[AND pg.group_status_ = 'NORMAL'
 			]]>
             </if>
             <if test='isOver !=null and isOver=="1"'>
-                <![CDATA[ AND pg.courses_expire_date_ <= NOW()
+                <![CDATA[ AND pg.group_status_ ='FINISH'
 			]]></if>
             <if test='hasReport !=null and hasReport=="0"'>
                 <![CDATA[AND cse.status_ =0
@@ -339,7 +339,9 @@
                pg.single_class_minutes_ total_minutes_
         FROM practice_group pg
                  LEFT JOIN class_group cg on pg.id_ = cg.music_group_id_ AND cg.group_type_ = 'PRACTICE'
-        WHERE pg.courses_start_date_ <= #{nowDate,jdbcType=DATE}
+        WHERE cg.group_type_ = 'PRACTICE'
+          AND pg.buy_months_ >= 1
+          AND pg.courses_start_date_ <= #{nowDate,jdbcType=DATE}
           AND pg.courses_expire_date_ >= #{afterDate,jdbcType=DATE}
         ]]>
         <if test="afterDateIsLastDay == false">
@@ -351,7 +353,6 @@
           AND cg.del_flag_ = 0
           AND pg.group_status_ != 'CANCEL'
           AND pg.group_status_ != 'LOCK'
-
     </select>
 
     <select id="getReportCourseTimes" resultMap="com.ym.mec.biz.dal.dao.ClassGroupDao.ClassGroup">