dzx 4 ay önce
ebeveyn
işleme
72093171fb

+ 6 - 0
src/main/java/com/xjrsoft/module/banding/dto/BandingTaskClassPageDto.java

@@ -18,4 +18,10 @@ public class BandingTaskClassPageDto{
 
     @ApiModelProperty("任务id")
     private Long bandingTaskId;
+
+    @ApiModelProperty("年级id")
+    private Long gradeId;
+
+    @ApiModelProperty("招生类型")
+    private String enrollType;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -74,6 +74,9 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
 
     @Override
     public List<BandingTaskClassPageVo> getList(BandingTaskClassPageDto dto) {
+        BandingTask bandingTask = bandingTaskMapper.selectById(dto.getBandingTaskId());
+        dto.setGradeId(bandingTask.getGradeId());
+        dto.setEnrollType(bandingTask.getEnrollType());
         return this.baseMapper.getList(dto);
     }
 

+ 8 - 2
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -5,8 +5,14 @@
 <mapper namespace="com.xjrsoft.module.banding.mapper.BandingTaskClassMapper">
     <select id="getList" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassPageVo">
         SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name, t1.number,t1.sort_code,t1.is_order_class,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND first_ambition_id = t1.major_set_id) AS first_ambition_count,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND second_ambition_id = t1.major_set_id) AS second_ambition_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN enrollment_plan a2 ON a1.enrollment_plan_id = a2.id
+        WHERE a1.delete_mark = 0 AND a1.first_ambition_id = t1.major_set_id
+        AND a2.enroll_type = #{enrollType} AND a2.grade_id =#{gradeId} ) AS first_ambition_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN enrollment_plan a2 ON a1.enrollment_plan_id = a2.id
+        WHERE a1.delete_mark = 0 AND a1.second_ambition_id = t1.major_set_id
+        AND a2.enroll_type = #{enrollType} AND a2.grade_id =#{gradeId} ) AS second_ambition_count,
         t5.height, t5.score, (
             SELECT count(a1.id) FROM base_new_student a1
             INNER JOIN banding_task_class_student t5 ON a1.id = t5.new_student_id