瀏覽代碼

Merge remote-tracking branch 'origin/music_detail' into music_detail

Joburgess 4 年之前
父節點
當前提交
8948fd38a1

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.dto.ClassGroupTeachersDto;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.CourseListDto;
 import com.ym.mec.biz.dal.dto.CourseListDto;
 import com.ym.mec.biz.dal.dto.HighClassGroupDto;
 import com.ym.mec.biz.dal.dto.HighClassGroupDto;
+import com.ym.mec.biz.dal.dto.Mapper;
 import com.ym.mec.biz.dal.dto.MusicGroupClassGroupDto;
 import com.ym.mec.biz.dal.dto.MusicGroupClassGroupDto;
 import com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto;
 import com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto;
 import com.ym.mec.biz.dal.dto.StudentPayInfoDto;
 import com.ym.mec.biz.dal.dto.StudentPayInfoDto;
@@ -836,4 +837,6 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<Long> queryGroupClassGroupIds(Integer userId);
     List<Long> queryGroupClassGroupIds(Integer userId);
 
 
     int countCourseNum(@Param("classGroupId") Integer classGroupId, @Param("teachMode") String teachMode);
     int countCourseNum(@Param("classGroupId") Integer classGroupId, @Param("teachMode") String teachMode);
+    
+    List<Mapper> countTeacherByMusicGroupId(String musicGroupId);
 }
 }

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -632,4 +632,18 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
     List<StudentRegistration> queryMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic,
     List<StudentRegistration> queryMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic,
                                                           @Param("educationUserId") Integer educationUserId,
                                                           @Param("educationUserId") Integer educationUserId,
                                                           @Param("organIds") String organIds);
                                                           @Param("organIds") String organIds);
+    
+    /**
+     * 统计指定乐团在读的声部人数
+     * @param musicGroupId
+     * @return
+     */
+    List<Mapper> countStudentWithSubjectByMusicGroupId(String musicGroupId);
+
+    /**
+     * 统计各年级人数
+     * @param musicGroupId
+     * @return
+     */
+    List<Mapper> countStudentWithGradeByMusicGroupId(String musicGroupId);
 }
 }

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -40,6 +40,11 @@
         <result column="status" property="musicGroupStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="status" property="musicGroupStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
     </resultMap>
 
 
+    <resultMap id="Mapper" type="com.ym.mec.biz.dal.dto.Mapper">
+        <result column="key_" property="key"/>
+        <result column="value_" property="value"/>
+    </resultMap>
+
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ClassGroup" useGeneratedKeys="true" keyColumn="id"
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ClassGroup" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
             keyProperty="id">
         INSERT INTO class_group
         INSERT INTO class_group
@@ -1521,4 +1526,10 @@
     <select id="countCourseNum" resultType="int">
     <select id="countCourseNum" resultType="int">
         SELECT COUNT(id_) FROM course_schedule WHERE class_group_id_ = #{classGroupId} AND teach_mode_ = #{teachMode} AND pre_course_flag_ = 0
         SELECT COUNT(id_) FROM course_schedule WHERE class_group_id_ = #{classGroupId} AND teach_mode_ = #{teachMode} AND pre_course_flag_ = 0
     </select>
     </select>
+    
+    <select id="countTeacherByMusicGroupId" resultMap="Mapper">
+		select cg.name_ key_,GROUP_CONCAT(u.real_name_) value_ from class_group cg LEFT JOIN class_group_teacher_mapper cgtm on cg.id_ = cgtm.class_group_id_
+		LEFT JOIN sys_user u on u.id_ = cgtm.user_id_
+		where cg.del_flag_ = 0 and cg.group_type_ = 'MUSIC' and cg.music_group_id_ = #{musicGroupId}  group by cg.name_ 
+    </select>
 </mapper>
 </mapper>

+ 17 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -99,6 +99,11 @@
         <result column="group_name_" property="groupName"/>
         <result column="group_name_" property="groupName"/>
     </resultMap>
     </resultMap>
 
 
+    <resultMap id="Mapper" type="com.ym.mec.biz.dal.dto.Mapper">
+        <result column="key_" property="key"/>
+        <result column="value_" property="value"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentRegistration">
     <select id="get" resultMap="StudentRegistration">
         SELECT *
         SELECT *
@@ -1551,4 +1556,16 @@
             AND (MAX(cto.id_) IS NULL OR DATEDIFF(MAX(cto.end_time_),NOW()) &lt; 0)
             AND (MAX(cto.id_) IS NULL OR DATEDIFF(MAX(cto.end_time_),NOW()) &lt; 0)
         </if>
         </if>
     </select>
     </select>
+    
+    <select id="countStudentWithSubjectByMusicGroupId" resultMap="Mapper">
+        select s.name_ key_,count(sr.id_) value_ from student_registration sr LEFT JOIN subject s on sr.actual_subject_id_ = s.id_ 
+		where sr.music_group_status_ = 'NORMAL' and sr.music_group_id_ = #{musicGroupId} 
+		group by sr.actual_subject_id_
+    </select>
+    
+    <select id="countStudentWithGradeByMusicGroupId" resultMap="Mapper">
+        select s.current_grade_num_ key_,count(sr.id_) value_ from student_registration sr LEFT JOIN student s on sr.user_id_= s.user_id_
+		where sr.music_group_status_ = 'NORMAL' and sr.music_group_id_ = #{musicGroupId} 
+		group by s.current_grade_num_
+    </select>
 </mapper>
 </mapper>

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupRecordController.java

@@ -5,10 +5,13 @@ import io.swagger.annotations.ApiOperation;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dto.MusicGroupBasicDto;
 import com.ym.mec.biz.dal.dto.MusicGroupBasicDto;
 import com.ym.mec.biz.service.CooperationOrganLinkmanService;
 import com.ym.mec.biz.service.CooperationOrganLinkmanService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupService;
@@ -24,6 +27,12 @@ public class MusicGroupRecordController extends BaseController {
 	
 	
 	@Autowired
 	@Autowired
 	private MusicGroupService musicGroupService;
 	private MusicGroupService musicGroupService;
+	
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+	
+	@Autowired
+	private ClassGroupDao classGroupDao;
 
 
 	@ApiOperation(value = "查询基本信息")
 	@ApiOperation(value = "查询基本信息")
 	@GetMapping("/queryBasicInfo")
 	@GetMapping("/queryBasicInfo")
@@ -39,4 +48,18 @@ public class MusicGroupRecordController extends BaseController {
 		
 		
 		return succeed(musicGroupBasicDto);
 		return succeed(musicGroupBasicDto);
 	}
 	}
+
+	@ApiOperation(value = "查询学员、师资")
+	@GetMapping("/queryStudentAndTeacher")
+	@PreAuthorize("@pcs.hasPermissions('musicGroupRecord/queryStudentAndTeacher')")
+	public Object queryStudentAndTeacher(String musicGroupId) {
+		
+		ModelMap model = new ModelMap();
+
+		model.put("subject", studentRegistrationDao.countStudentWithSubjectByMusicGroupId(musicGroupId));
+		model.put("grade", studentRegistrationDao.countStudentWithGradeByMusicGroupId(musicGroupId));
+		model.put("teacher", classGroupDao.countTeacherByMusicGroupId(musicGroupId));
+		
+		return succeed(model);
+	}
 }
 }