zouxuan 5 年之前
父節點
當前提交
a86835676d

+ 8 - 6
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -557,16 +557,18 @@
     </resultMap>
     <select id="queryStudentPer" resultMap="StudentRegisterPerDtoMap">
         SELECT a.name_ organ_name_,a.num student_num_,b.num per_num_,ifnull(b.num,0)*100/a.num per_ FROM (
-        SELECT b.name_,COUNT(a.id_) num,b.id_ FROM sys_user a LEFT JOIN organization b on a.organ_id_=b.id_
+        SELECT b.name_,COUNT(a.id_) num,b.id_ FROM sys_user a LEFT JOIN organization b ON a.organ_id_=b.id_
         WHERE a.id_ IN(
-        SELECT b.id_ FROM course_schedule_student_payment a LEFT JOIN sys_user b ON a.user_id_=b.id_ WHERE b.user_type_='STUDENT' GROUP BY a.user_id_,b.organ_id_ )
-        AND b.del_flag_ = 0
+        SELECT b.id_ FROM course_schedule_student_payment a LEFT JOIN sys_user b ON a.user_id_=b.id_
+        LEFT JOIN course_schedule c ON a.course_schedule_id_=c.id_ WHERE b.user_type_='STUDENT' AND c.status_ IN('UNDERWAY','NOT_START')
+        GROUP BY a.user_id_,b.organ_id_ )
         GROUP BY organ_id_) a
         LEFT JOIN
-        (SELECT b.name_,COUNT(a.id_) num,b.id_ FROM sys_user a LEFT JOIN organization b on a.organ_id_=b.id_
+        (SELECT b.name_,COUNT(a.id_) num,b.id_ FROM sys_user a LEFT JOIN organization b ON a.organ_id_=b.id_
         WHERE a.id_ IN(
-        SELECT b.id_ FROM course_schedule_student_payment a LEFT JOIN sys_user b ON a.user_id_=b.id_ WHERE b.user_type_='STUDENT' AND password_ IS NOT NULL GROUP BY a.user_id_,b.organ_id_ )
-        AND b.del_flag_ = 0
+        SELECT b.id_ FROM course_schedule_student_payment a LEFT JOIN sys_user b ON a.user_id_=b.id_
+        LEFT JOIN course_schedule c ON a.course_schedule_id_ = c.id_
+        WHERE b.user_type_='STUDENT' AND password_ IS NOT NULL AND c.status_ IN('UNDERWAY','NOT_START') GROUP BY a.user_id_,b.organ_id_ )
         GROUP BY organ_id_) b
         ON a.id_=b.id_
         WHERE a.name_ IS NOT NULL

+ 1 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SmsCodeController.java

@@ -3,6 +3,7 @@ package com.ym.mec.student.controller;
 import com.google.code.kaptcha.Constants;
 import com.google.code.kaptcha.Producer;
 import com.google.code.kaptcha.servlet.KaptchaServlet;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.service.SmsCodeService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;