فهرست منبع

Merge remote-tracking branch 'origin/master'

Joburgess 5 سال پیش
والد
کامیت
555a0c73f8
1فایلهای تغییر یافته به همراه30 افزوده شده و 31 حذف شده
  1. 30 31
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

+ 30 - 31
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -25,7 +25,7 @@
         <result column="group_status_" property="groupStatus"
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="be_renew_group_id_" property="beRenewGroupId"/>
-        <result column="educational_teacher_id_" property="educationalTeacherId" />
+        <result column="educational_teacher_id_" property="educationalTeacherId"/>
     </resultMap>
 
     <resultMap id="PracticeCourseDto" type="com.ym.mec.biz.dal.dto.PracticeCourseDto" extends="PracticeGroup">
@@ -58,28 +58,28 @@
         WHERE id_ = #{practiceGroupId}
     </update>
 
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup">
-		UPDATE practice_group
-		<set>
-			<if test="subjectId!=null">
-				subject_id_=#{subjectId},
-			</if>
-			<if test="memo!=null">
-				memo_=#{memo},
-			</if>
-			<if test="name!=null">
-				name_=#{name},
-			</if>
-			<if test="groupStatus!=null">
-				group_status_=#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-			</if>
-			<if test="educationalTeacherId!=null">
-				educational_teacher_id_=#{educationalTeacherId},
-			</if>
-			update_time_ = NOW()
-		</set>
-		WHERE id_ = #{id}
-	</update>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup">
+        UPDATE practice_group
+        <set>
+            <if test="subjectId!=null">
+                subject_id_=#{subjectId},
+            </if>
+            <if test="memo!=null">
+                memo_=#{memo},
+            </if>
+            <if test="name!=null">
+                name_=#{name},
+            </if>
+            <if test="groupStatus!=null">
+                group_status_=#{groupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="educationalTeacherId!=null">
+                educational_teacher_id_=#{educationalTeacherId},
+            </if>
+            update_time_ = NOW()
+        </set>
+        WHERE id_ = #{id}
+    </update>
 
     <update id="batchUpdate">
         <foreach collection="groups" item="group" separator=";">
@@ -272,7 +272,7 @@
 
     <sql id="practiceGroupReviewsQueryCondition">
         <where>
-            pg.group_status_ != 'CANCEL' AND pg.group_status_ != 'LOCK'
+            pg.group_status_ != 'LOCK'
             <if test="month != null">
                 AND DATE_FORMAT(cse.create_time_, '%Y-%m') = #{month}
             </if>
@@ -339,7 +339,7 @@
                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 cg.group_type_ = 'PRACTICE'
+         WHERE pg.group_status_ = 'NORMAL' AND 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}
@@ -348,11 +348,9 @@
             AND DATE_FORMAT(pg.courses_expire_date_, '%d') = DATE_FORMAT(#{afterDate}, '%d')
         </if>
         <if test="afterDateIsLastDay == true">
-        <![CDATA[ AND DATE_FORMAT(pg.courses_expire_date_, '%d') >= DATE_FORMAT(#{afterDate}, '%d') ]]>
+            <![CDATA[ AND DATE_FORMAT(pg.courses_expire_date_, '%d') >= DATE_FORMAT(#{afterDate}, '%d') ]]>
         </if>
-          AND cg.del_flag_ = 0
-          AND pg.group_status_ != 'CANCEL'
-          AND pg.group_status_ != 'LOCK'
+        AND cg.del_flag_ = 0
     </select>
 
     <select id="getReportCourseTimes" resultMap="com.ym.mec.biz.dal.dao.ClassGroupDao.ClassGroup">
@@ -366,8 +364,9 @@
     </select>
 
     <select id="findByGroupId" resultMap="PracticeCourseDto">
-        SELECT pg.*,s.name_ subject_name_ FROM practice_group pg
-        LEFT JOIN subject s on pg.subject_id_ = s.id_
+        SELECT pg.*, s.name_ subject_name_
+        FROM practice_group pg
+                 LEFT JOIN subject s on pg.subject_id_ = s.id_
         WHERE pg.id_ = #{id}
     </select>
 </mapper>