فهرست منبع

活动排课资格调整

zouxuan 3 سال پیش
والد
کامیت
d833a9b758

+ 10 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -1020,26 +1020,34 @@ public class StudentManageServiceImpl implements StudentManageService {
         MapUtil.populateMap(params, queryInfo);
         List<Integer> studentIds = new ArrayList<>();
         params.put("studentIds",studentIds);
+        PageInfo<Student> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         if(queryInfo.getHasMusicCourse() != null){
             params.put("groupType","MUSIC");
             params.put("hasCourse",queryInfo.getHasMusicCourse());
             studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
+            if(studentIds == null || studentIds.size() == 0){
+                return pageInfo;
+            }
         }
         if(queryInfo.getHasPracticeCourse() != null){
             params.put("groupType","PRACTICE");
             params.put("hasCourse",queryInfo.getHasPracticeCourse());
             params.put("studentIds",studentIds);
             studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
+            if(studentIds == null || studentIds.size() == 0){
+                return pageInfo;
+            }
         }
         if(queryInfo.getHasVipCourse() != null){
             params.put("groupType","VIP");
             params.put("hasCourse",queryInfo.getHasVipCourse());
             params.put("studentIds",studentIds);
             studentIds = courseScheduleDao.queryHasCourseStudentIds(params);
+            if(studentIds == null || studentIds.size() == 0){
+                return pageInfo;
+            }
         }
         params.put("studentIds",studentIds);
-
-        PageInfo<Student> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         List<Student> dataList = null;
         int count = studentDao.countStudent(params);
         if (count > 0) {

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -251,5 +251,6 @@
 			AND FIND_IN_SET(su.organ_id_,#{organId})
 		</if>
 		GROUP BY aum.user_id_
+		<include refid="global.limit"/>
 	</select>
 </mapper>

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

@@ -4081,17 +4081,11 @@
         LEFT JOIN course_schedule_student_payment cssp ON s.user_id_ = cssp.user_id_
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
         WHERE cs.group_type_ = #{groupType} AND cs.del_flag_ = 0 AND cs.pre_course_flag_ = 0
-        <if test="hasCourse == '1'">
-            AND cs.status_ = 'NOT_START'
-        </if>
-        <if test="hasCourse == '0'">
-            AND cs.status_ != 'NOT_START'
-        </if>
         <if test="hasMember != null">
-            <if test="hasMember == '1'">
+            <if test="hasMember == 1">
                 AND s.member_rank_setting_id_ IS NOT NULL
             </if>
-            <if test="hasMember == '0'">
+            <if test="hasMember == 0">
                 AND s.member_rank_setting_id_ IS NULL
             </if>
         </if>
@@ -4101,5 +4095,11 @@
                 #{studentId}
             </foreach>
         </if>
+        <if test="hasCourse == 1">
+            GROUP BY s.user_id_ HAVING COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 ELSE NULL END) > 0
+        </if>
+        <if test="hasCourse == 0">
+            GROUP BY s.user_id_ HAVING COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 ELSE NULL END) &lt;= 0
+        </if>
     </select>
 </mapper>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -1388,7 +1388,7 @@
                 </foreach>
             </if>
             <if test="subjectId != null">
-                s.subject_id_list_ = #{subjectId}
+                AND s.subject_id_list_ = #{subjectId}
             </if>
             <if test="search != null and search != ''">
                 AND (s.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
@@ -1411,7 +1411,7 @@
                 </foreach>
             </if>
             <if test="subjectId != null">
-                s.subject_id_list_ = #{subjectId}
+                AND s.subject_id_list_ = #{subjectId}
             </if>
             <if test="search != null and search != ''">
                 AND (s.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))