zouxuan 5 years ago
parent
commit
d40578c87b

+ 21 - 9
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -2,11 +2,10 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.web.dal.entity.StudentRegistration;
+import com.ym.mec.web.dal.page.StudentApplyDetailQueryInfo;
 import com.ym.mec.web.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.web.service.StudentRegistrationService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -44,12 +43,6 @@ public class StudentRegistrationController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "分页查询学生乐团报名详情")
-    @PostMapping("/queryStudentDetailPage")
-    public Object queryStudentDetailPage(@RequestBody StudentRegistrationQueryInfo queryInfo){
-        return succeed(studentRegistrationService.queryStudentDetailPage(queryInfo));
-    }
-
     @ApiOperation(value = "批量调剂学生报名专业")
     @PutMapping("/batchUpdateSubject")
     public Object batchUpdateSubject(@RequestBody HashMap<String,String> param){
@@ -60,4 +53,23 @@ public class StudentRegistrationController extends BaseController {
         }
         return succeed(studentRegistrationService.batchUpdateSubject(userId,Integer.parseInt(subId)));
     }
+
+    @ApiOperation(value = "乐团【报名中、缴费中】 学生详情列表分页查询")
+    @PostMapping("/queryStudentApplyDetail")
+    public Object queryStudentApplyDetail(@RequestBody StudentRegistrationQueryInfo queryInfo){
+        return succeed(studentRegistrationService.queryStudentDetailPage(queryInfo));
+    }
+
+    @ApiOperation(value = "学生报名缴费金额详情")
+    @GetMapping("/queryFeeDetail")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "studentId", value = "学生编号", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
+    public Object queryFeeDetail(@RequestBody HashMap<String,String> param){
+        String studentId = param.get("studentId");
+        String musicGroupId = param.get("musicGroupId");
+        if(StringUtils.isEmpty(studentId) || StringUtils.isEmpty(musicGroupId)){
+            return succeed(studentRegistrationService.queryFeeDetail(Integer.parseInt(studentId),musicGroupId));
+        }
+        return failed();
+    }
 }

+ 9 - 2
mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -74,9 +74,16 @@ public class SubjectController extends BaseController {
     }
 
     @ApiOperation(value = "通过乐团收费类型,获取默认的声部列表")
-    @PostMapping("/findDefaultSubByGroupId")
+    @GetMapping("/findDefaultSubByGroupId")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
-    public Object findDefaultSubByGroupId(@RequestBody Integer musicGroupId){
+    public Object findDefaultSubByGroupId(@RequestParam Integer musicGroupId){
         return succeed(subjectService.findDefaultSubByGroupId(musicGroupId));
     }
+
+    @ApiOperation(value = "通过乐团编号获取声部列表以及声部报名、缴费、计划人数")
+    @GetMapping("/findSubApplyDetail")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
+    public Object findSubApplyDetail(@RequestBody Integer musicGroupId){
+        return succeed(subjectService.findSubApplyDetail(musicGroupId));
+    }
 }

+ 18 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/StudentRegistrationDao.java

@@ -1,8 +1,10 @@
 package com.ym.mec.web.dal.dao;
 
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.dto.StudentFeeDto;
 import com.ym.mec.web.dal.entity.StudentRegistration;
 import com.ym.mec.web.dal.dto.StudentApplyDetailDto;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -22,4 +24,20 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     int queryStudentDetailCount(Map<String, Object> params);
+
+    /**
+     * 根据乐团编号和声部获取缴费学员人数
+     * @param musicGroupId
+     * @param subjectId
+     * @return
+     */
+    Integer countPayNum(@Param("musicGroupId") Integer musicGroupId, @Param("subjectId") Integer subjectId);
+
+    /**
+     * 学生报名缴费金额详情
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    StudentFeeDto queryFeeDetail(Integer studentId, String musicGroupId);
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/SubjectDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.dal.dao;
 
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.web.dal.entity.Subject;
 import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import org.apache.ibatis.annotations.Param;
@@ -43,4 +44,11 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      * @return
      */
     List<Subject> findDefaultSubByGroupId(Integer musicGroupId);
+
+    /**
+     * 通过乐团编号获取声部列表以及声部报名、缴费、计划人数
+     * @param musicGroupId
+     * @return
+     */
+    List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId);
 }

+ 27 - 2
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentApplyDetailDto.java

@@ -1,11 +1,14 @@
 package com.ym.mec.web.dal.dto;
 
+import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 import com.ym.mec.common.enums.UserGenderEnum;
 import com.ym.mec.web.dal.enums.YesOrNoEnum;
 
-public class StudentApplyDetailDto {
+import java.math.BigDecimal;
+
+public class StudentApplyDetailDto extends QueryInfo {
 
     @ApiModelProperty(value = "学生姓名",required = false)
     private String studentName;
@@ -28,12 +31,34 @@ public class StudentApplyDetailDto {
     @ApiModelProperty(value = "是否允许调剂",required = false)
     private YesOrNoEnum isAllowAdjust;
 
-    @ApiModelProperty(value = "专业名称",required = false)
+    @ApiModelProperty(value = "报名专业名称",required = false)
     private String subjectName;
 
+    @ApiModelProperty(value = "实际专业名称",required = false)
+    private String actualSubjectName;
+
     @ApiModelProperty(value = "家长电话",required = false)
     private String parentsPhone;
 
+    @ApiModelProperty(value = "学员缴费状态",required = false)
+    private YesOrNoEnum paymentStatus;
+
+    public String getActualSubjectName() {
+        return actualSubjectName;
+    }
+
+    public void setActualSubjectName(String actualSubjectName) {
+        this.actualSubjectName = actualSubjectName;
+    }
+
+    public YesOrNoEnum getPaymentStatus() {
+        return paymentStatus;
+    }
+
+    public void setPaymentStatus(YesOrNoEnum paymentStatus) {
+        this.paymentStatus = paymentStatus;
+    }
+
     public String getStudentName() {
         return studentName;
     }

+ 52 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentFeeDto.java

@@ -0,0 +1,52 @@
+package com.ym.mec.web.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class StudentFeeDto {
+
+    @ApiModelProperty(value = "课程费用",required = false)
+    private BigDecimal courseFee;
+
+    @ApiModelProperty(value = "乐器费用",required = false)
+    private BigDecimal musicalFee;
+
+    @ApiModelProperty(value = "保证金",required = false)
+    private BigDecimal depositFee;
+
+    @ApiModelProperty(value = "实缴总额",required = false)
+    private BigDecimal totalAmount;
+
+    public BigDecimal getCourseFee() {
+        return courseFee;
+    }
+
+    public void setCourseFee(BigDecimal courseFee) {
+        this.courseFee = courseFee;
+    }
+
+    public BigDecimal getMusicalFee() {
+        return musicalFee;
+    }
+
+    public void setMusicalFee(BigDecimal musicalFee) {
+        this.musicalFee = musicalFee;
+    }
+
+    public BigDecimal getDepositFee() {
+        return depositFee;
+    }
+
+    public void setDepositFee(BigDecimal depositFee) {
+        this.depositFee = depositFee;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+}

+ 75 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/SubjectApplyDetailDto.java

@@ -0,0 +1,75 @@
+package com.ym.mec.web.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 乐团声部报名详情
+ */
+public class SubjectApplyDetailDto {
+
+    @ApiModelProperty(value = "科目编号",required = false)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "科目名称",required = false)
+    private String subjectName;
+
+    @ApiModelProperty(value = "预计招收人数",required = false)
+    private Integer expectedStudentNum;
+
+    @ApiModelProperty(value = "实际招收人数",required = false)
+    private Integer applyStudentNum;
+
+    @ApiModelProperty(value = "缴费人数",required = false)
+    private Integer payNum;
+
+    @ApiModelProperty(value = "未分班人数",required = false)
+    private Integer notPartClassNum;
+
+    public Integer getNotPartClassNum() {
+        return notPartClassNum;
+    }
+
+    public void setNotPartClassNum(Integer notPartClassNum) {
+        this.notPartClassNum = notPartClassNum;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getExpectedStudentNum() {
+        return expectedStudentNum;
+    }
+
+    public void setExpectedStudentNum(Integer expectedStudentNum) {
+        this.expectedStudentNum = expectedStudentNum;
+    }
+
+    public Integer getApplyStudentNum() {
+        return applyStudentNum;
+    }
+
+    public void setApplyStudentNum(Integer applyStudentNum) {
+        this.applyStudentNum = applyStudentNum;
+    }
+
+    public Integer getPayNum() {
+        return payNum;
+    }
+
+    public void setPayNum(Integer payNum) {
+        this.payNum = payNum;
+    }
+}

+ 12 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/StudentRegistration.java

@@ -32,6 +32,10 @@ public class StudentRegistration {
 	/** 报名科目 */
 	@ApiModelProperty(value = "报名科目",required = false)
 	private Integer subjectId;
+
+	/** 报名科目 */
+	@ApiModelProperty(value = "实际科目",required = false)
+	private Integer actualSubjectId;
 	
 	/** 是否允许调剂 */
 	@ApiModelProperty(value = "是否允许调剂",required = false)
@@ -75,6 +79,14 @@ public class StudentRegistration {
 	@ApiModelProperty(value = "预计下次缴费日期",required = false)
 	private java.util.Date nextPaymentDate;
 
+	public Integer getActualSubjectId() {
+		return actualSubjectId;
+	}
+
+	public void setActualSubjectId(Integer actualSubjectId) {
+		this.actualSubjectId = actualSubjectId;
+	}
+
 	public String getParentsPhone() {
 		return parentsPhone;
 	}

+ 41 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/StudentApplyDetailQueryInfo.java

@@ -0,0 +1,41 @@
+package com.ym.mec.web.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+public class StudentApplyDetailQueryInfo extends QueryInfo {
+    /** 是否允许调剂 */
+    @ApiModelProperty(value = "是否允许调剂",required = false)
+    private YesOrNoEnum isAllowAdjust;
+
+    @ApiModelProperty(value = "报名专业名称",required = false)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "实际专业名称",required = false)
+    private Integer actualSubjectId;
+
+    public YesOrNoEnum getIsAllowAdjust() {
+        return isAllowAdjust;
+    }
+
+    public void setIsAllowAdjust(YesOrNoEnum isAllowAdjust) {
+        this.isAllowAdjust = isAllowAdjust;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getActualSubjectId() {
+        return actualSubjectId;
+    }
+
+    public void setActualSubjectId(Integer actualSubjectId) {
+        this.actualSubjectId = actualSubjectId;
+    }
+}

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/StudentRegistrationQueryInfo.java

@@ -15,6 +15,17 @@ public class StudentRegistrationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "专业编号",required = false)
     private Integer subjectId;
 
+    @ApiModelProperty(value = "实际专业编号",required = false)
+    private Integer actualSubjectId;
+
+    public Integer getActualSubjectId() {
+        return actualSubjectId;
+    }
+
+    public void setActualSubjectId(Integer actualSubjectId) {
+        this.actualSubjectId = actualSubjectId;
+    }
+
     public Integer getMusicGroupId() {
         return musicGroupId;
     }

+ 13 - 0
mec-web/src/main/java/com/ym/mec/web/service/StudentRegistrationService.java

@@ -2,10 +2,15 @@ package com.ym.mec.web.service;
 
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import com.ym.mec.web.dal.dto.StudentFeeDto;
 import com.ym.mec.web.dal.entity.StudentRegistration;
+import com.ym.mec.web.dal.page.StudentApplyDetailQueryInfo;
 import com.ym.mec.web.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.web.dal.dto.StudentApplyDetailDto;
 
+import java.util.HashMap;
+import java.util.List;
+
 public interface StudentRegistrationService extends BaseService<Long, StudentRegistration> {
 
     /**
@@ -22,4 +27,12 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @return
      */
     boolean batchUpdateSubject(String userId, Integer subId);
+
+    /**
+     * 学生报名缴费金额详情
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    StudentFeeDto queryFeeDetail(Integer studentId,String musicGroupId);
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/SubjectService.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.service;
 
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import com.ym.mec.web.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.web.dal.entity.Subject;
 import com.ym.mec.web.dal.page.SubjectQueryInfo;
 import org.apache.ibatis.annotations.Param;
@@ -44,4 +45,11 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      * @return
      */
     List<Subject> findDefaultSubByGroupId(Integer musicGroupId);
+
+    /**
+     * 通过乐团编号获取声部列表以及声部报名、缴费、计划人数
+     * @param musicGroupId
+     * @return
+     */
+    List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId);
 }

+ 13 - 7
mec-web/src/main/java/com/ym/mec/web/service/impl/StudentRegistrationServiceImpl.java

@@ -1,19 +1,19 @@
 package com.ym.mec.web.service.impl;
 
+import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.web.dal.dao.StudentRegistrationDao;
+import com.ym.mec.web.dal.dto.StudentApplyDetailDto;
+import com.ym.mec.web.dal.dto.StudentFeeDto;
+import com.ym.mec.web.dal.entity.StudentRegistration;
 import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import com.ym.mec.web.dal.page.StudentRegistrationQueryInfo;
-import com.ym.mec.web.dal.dto.StudentApplyDetailDto;
+import com.ym.mec.web.service.StudentRegistrationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.web.dal.dao.StudentRegistrationDao;
-import com.ym.mec.web.dal.entity.StudentRegistration;
-import com.ym.mec.web.service.StudentRegistrationService;
-
 import java.util.*;
 
 @Service
@@ -62,4 +62,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 		}
 		return true;
 	}
+
+	@Override
+	public StudentFeeDto queryFeeDetail(Integer studentId,String musicGroupId) {
+//		return studentRegistrationDao.queryFeeDetail(studentId,musicGroupId);
+		return null;
+	}
 }

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/SubjectServiceImpl.java

@@ -3,7 +3,9 @@ package com.ym.mec.web.service.impl;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.StudentRegistrationDao;
 import com.ym.mec.web.dal.dao.SubjectDao;
+import com.ym.mec.web.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.web.dal.entity.Subject;
 import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import com.ym.mec.web.dal.page.SubjectQueryInfo;
@@ -12,12 +14,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  implements SubjectService {
 	
 	@Autowired
 	private SubjectDao subjectDao;
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
 
 	@Override
 	public BaseDAO<Integer, Subject> getDAO() {
@@ -53,6 +58,15 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  imple
 		return subjectDao.findDefaultSubByGroupId(musicGroupId);
 	}
 
+	@Override
+	public List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId) {
+		List<SubjectApplyDetailDto> subApplyDetail = subjectDao.findSubApplyDetail(musicGroupId);
+		subApplyDetail.forEach(detail ->{
+			detail.setPayNum(studentRegistrationDao.countPayNum(musicGroupId,detail.getSubjectId()));
+		});
+		return subApplyDetail;
+	}
+
 	private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
 		//得到根节点对象
 		//获取子节点list

+ 42 - 21
mec-web/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -13,6 +13,7 @@
         <result column="current_grade_" property="currentGrade"/>
         <result column="current_class_" property="currentClass"/>
         <result column="subject_id_" property="subjectId"/>
+        <result column="actual_subject_id_" property="actualSubjectId"/>
         <result column="is_allow_adjust_" property="isAllowAdjust" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="kit_purchase_method_" property="kitPurchaseMethod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="remark_" property="remark"/>
@@ -39,15 +40,10 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentRegistration" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
         INSERT INTO student_registration
-        (parents_phone_,id_,user_id_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_)
+        (parents_phone_,id_,user_id_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_,actual_subject_id_)
         VALUES(#{parentsPhone},#{id},#{userId},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate})
+        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -99,6 +95,9 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="actualSubjectId != null">
+                actual_subject_id_ = #{actualSubjectId},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>
@@ -130,35 +129,42 @@
 		SELECT COUNT(*) FROM student_registration
 	</select>
 
-    <resultMap type="com.ym.mec.web.dal.dto.StudentApplyDetailDto" id="studentApplyDetail">
-        <result column="current_grade_" property="currentGrade"/>
-        <result column="current_class_" property="currentClass"/>
-        <result column="is_allow_adjust_" property="isAllowAdjust" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="parents_name_" property="parentsName"/>
-        <result column="parents_phone_" property="parentsPhone"/>
-        <result column="subject_name_" property="subjectName"/>
-        <result column="student_name_" property="studentName"/>
-        <result column="gender_" property="gender"/>
-    </resultMap>
+
     <sql id="queryStudentDetailPageSql">
         <where>
-            <if test="musicGroupId">
+            <if test="musicGroupId != null">
                 sr.music_group_id_ = #{musicGroupId}
             </if>
-            <if test="subjectId">
+            <if test="subjectId != null">
                 sr.subject_id_ = #{subjectId}
             </if>
-            <if test="isAllowAdjust">
+            <if test="isAllowAdjust != null">
                 sr.is_allow_adjust_ = #{isAllowAdjust}
             </if>
+            <if test="actualSubjectId != null">
+                sr.actual_subject_id_ = #{actualSubjectId}
+            </if>
         </where>
     </sql>
 
+    <resultMap type="com.ym.mec.web.dal.dto.StudentApplyDetailDto" id="studentApplyDetail">
+        <result column="current_grade_" property="currentGrade"/>
+        <result column="current_class_" property="currentClass"/>
+        <result column="is_allow_adjust_" property="isAllowAdjust" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="parents_name_" property="parentsName"/>
+        <result column="parents_phone_" property="parentsPhone"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result column="username_" property="studentName"/>
+        <result column="actual_subject_name_" property="actualSubjectName"/>
+        <result column="gender_" property="gender" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+    </resultMap>
     <select id="queryStudentDetailPage" resultMap="studentApplyDetail">
-        SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,su.gender_,sr.is_allow_adjust_, s.name_,sr.parents_phone_
+        SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
+        su.gender_,sr.is_allow_adjust_, s.name_ subject_name_,ss.name_ actual_subject_name_,sr.parents_phone_
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.subject_id_ = su.id_
         LEFT JOIN `subject` s ON sr.subject_id_ = s.id_
+        LEFT JOIN `subject` ss ON sr.actual_subject_id_ = s.id_
         <include refid="queryStudentDetailPageSql"/>
         <include refid="global.limit"/>
     </select>
@@ -166,4 +172,19 @@
         SELECT COUNT(sr.id_) FROM student_registration sr
         <include refid="queryStudentDetailPageSql"/>
     </select>
+
+    <select id="countPayNum" resultType="java.lang.Integer">
+        SELECT COUNT(DISTINCT user_id_) FROM student_registration
+        WHERE music_group_id_ = #{musicGroupId} AND subject_id_ = #{subjectId} AND payment_status_ = 1
+    </select>
+
+    <resultMap id="queryFeeDetailMap" type="com.ym.mec.web.dal.dto.StudentFeeDto">
+        <result column="deposit_fee_" property="depositFee"/>
+        <result column="course_fee_" property="courseFee"/>
+        <result column="musical_fee_" property="musicalFee"/>
+        <result column="total_amount_" property="totalAmount"/>
+    </resultMap>
+    <select id="queryFeeDetail" resultMap="queryFeeDetailMap">
+
+    </select>
 </mapper>

+ 17 - 0
mec-web/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -94,6 +94,7 @@
     <select id="findByParentId" resultMap="Subject">
         SELECT * FROM subject <include refid="querySubPageSql"/>
     </select>
+
     <select id="findDefaultSubByGroupId" resultMap="Subject">
         SELECT s.id_,s.name_,g.name_ goods_name_,g.id_ goods_id_,ctsm.kit_group_purchase_type_,ctsm.deposit_fee_,ctsm.fee_
         FROM music_group mg
@@ -104,6 +105,22 @@
         LEFT JOIN goods g ON gc.id_ = g.goods_category_id_
         WHERE mg.id_ = #{musicGroupId}
     </select>
+
+    <resultMap id="subApplyDetail" type="com.ym.mec.web.dal.dto.SubjectApplyDetailDto">
+        <result column="pay_num_" property="payNum"/>
+        <result column="name_" property="subjectName"/>
+        <result column="subject_id_" property="subjectId"/>
+        <result column="expected_student_num_" property="expectedStudentNum"/>
+        <result column="apply_student_num_" property="applyStudentNum"/>
+        <result column="not_part_class_num_" property="notPartClassNum"/>
+    </resultMap>
+    <select id="findSubApplyDetail" resultMap="subApplyDetail">
+        SELECT mgsp.subject_id_,s.name_,mgsp.expected_student_num_,mgsp.apply_student_num_
+        FROM music_group_subject_plan mgsp
+        LEFT JOIN `subject` s ON mgsp.subject_id_ = s.id_
+        WHERE mgsp.music_group_id_ =
+    </select>
+
     <sql id="querySubPageSql">
         <where>
             <if test="parentId != null">