浏览代码

首页查询优化

zouxuan 2 年之前
父节点
当前提交
7f52b0a492

+ 7 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -1,18 +1,17 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.ym.mec.biz.dal.dto.*;
-import org.apache.ibatis.annotations.Param;
-
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.GroupType;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Student> {
 
@@ -106,8 +105,6 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
                                                            @Param("sunday") String sunday,
                                                            @Param("studentIds") List<Integer> studentIds, @Param("tenantId") Integer tenantId);
 
-    List<StudentServeCourseDto> getNoCourseBeServeStudentInfo(@Param("studentIds") List<Integer> noCourseStudentIds, @Param("tenantId") Integer tenantId);
-
 
     List<StudentServeDto> getBeServiceStudentsInfoWithStudents(@Param("monday") String monday,
                                                                @Param("courseExpireDate") Date courseExpireDate,

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -123,7 +123,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		String startDate1 = startDate.toString();
 		String endDate1 = endDate.toString();
-		List<Integer> arrayList = new ArrayList<>(organIds);
+		List<Integer> arrayList = null;
+		if(!CollectionUtils.isEmpty(organIds)){
+			arrayList = new ArrayList<>(organIds);
+		}
 		Integer tenantId = queryInfo.getTenantId();
 		List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getIndexBaseData(organIds, dataTypes, startDate1, endDate1,tenantId);
 		if(Objects.isNull(indexBaseDatas)){

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

@@ -629,29 +629,6 @@
         ORDER BY cssp.user_id_,course_start_time_
     </select>
 
-    <select id="getNoCourseBeServeStudentInfo" resultMap="StudentServeCourseDto">
-        SELECT
-            sr.user_id_ student_id_,
-            stu.teacher_id_ lead_teacher_id_,
-            'MUSIC' group_type_,
-            sr.music_group_id_
-        FROM
-            student_registration sr
-            LEFT JOIN student stu ON sr.user_id_ = stu.user_id_
-            LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
-        WHERE
-            mg.del_flag_ = 0 and sr.tenant_id_ = #{tenantId}
-            AND mg.organ_id_ IS NOT NULL
-            AND mg.status_ = 'PROGRESS'
-            AND sr.music_group_status_ = 'NORMAL'
-            <if test="studentIds!=null and studentIds.size()>0">
-                AND sr.user_id_ IN
-                <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
-                    #{studentId}
-                </foreach>
-            </if>
-    </select>
-
     <select id="getStudentNames" resultType="string">
         SELECT username_ FROM sys_user WHERE id_ IN
         <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">