瀏覽代碼

增加查询班级学生接口

周箭河 5 年之前
父節點
當前提交
5fd0251e4e

+ 15 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -36,7 +36,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<Map<Integer,Integer>> countPayNum(@Param("musicGroupId") String musicGroupId);
+	List<Map<Integer, Integer>> countPayNum(@Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 学生报名缴费金额详情
@@ -62,10 +62,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<Map<Integer,Long>> getNoClassStuCountBySubjectId(@Param("musicGroupId") String musicGroupId);
+	List<Map<Integer, Long>> getNoClassStuCountBySubjectId(@Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 根据乐团id和user_id 更新
+	 *
 	 * @param studentRegistration
 	 * @return
 	 */
@@ -73,6 +74,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询学生信息
+	 *
 	 * @param userId
 	 * @return
 	 */
@@ -80,7 +82,8 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询用户指定乐团的报名信息
-	 * @param userId 用户编号
+	 *
+	 * @param userId       用户编号
 	 * @param musicGroupId 乐团编号
 	 * @return
 	 */
@@ -98,8 +101,17 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询用户是否存在
+	 *
 	 * @param phone
 	 * @return
 	 */
 	SysUser getSysUserByPhone(String phone);
+
+	/**
+	 * 获取班级学生
+	 * @param musicGroupId
+	 * @param classGroupId
+	 * @return
+	 */
+	List<StudentRegistration> findClassGroupStu(@Param("musicGroupId") String musicGroupId, @Param("classGroupId") Integer classGroupId);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
 
 public interface StudentRegistrationService extends BaseService<Long, StudentRegistration> {
 
@@ -130,4 +131,13 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	 * @return
 	 */
     Integer insertStudent(StudentRegistration studentRegistration) throws Exception;
+
+	/**
+	 * 获取班级学生
+	 * @param musicGroupId
+	 * @param classGroupId
+	 * @return
+	 */
+	List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
+
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -422,4 +422,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
     }
 
+    @Override
+    public List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId) {
+        return studentRegistrationDao.findClassGroupStu(musicGroupId, classGroupId);
+    }
 }

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

@@ -294,4 +294,9 @@
     <select id="getSysUserByPhone" resultMap="FindSysUser">
         SELECT * FROM sys_user WHERE phone_ = #{phone}
     </select>
+
+    <!-- 获取班级下的学生 -->
+    <select id="findClassGroupStu" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE music_group_id_= #{musicGroupId} AND class_group_id_=#{classGroupId}
+    </select>
 </mapper>

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -84,4 +84,12 @@ public class StudentRegistrationController extends BaseController {
         return succeed(studentRegistrationService.getNoClassStuBySubjectId(musicGroupId, actualSubjectId));
     }
 
+    @ApiOperation(value = "获取班级学生")
+    @GetMapping("/getClassStu")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
+    public Object getClassStu(String musicGroupId, int classGroupId) {
+        return succeed(studentRegistrationService.findClassGroupStu(musicGroupId, classGroupId));
+    }
+
 }