Kaynağa Gözat

分班确认后,固化班级和学生关系数据并调整查询逻辑

dzx 6 ay önce
ebeveyn
işleme
6e9e5c7f5a

+ 91 - 0
src/main/java/com/xjrsoft/module/banding/entity/BandingTaskClassStudentSure.java

@@ -0,0 +1,91 @@
+package com.xjrsoft.module.banding.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * @title: 新生分班任务班级配置
+ * @Author dzx
+ * @Date: 2024-07-01
+ * @Version 1.0
+ */
+@Data
+@TableName("banding_task_class_student_sure")
+@ApiModel(value = "banding_task_class_student_sure", description = "新生分班任务班级学生关系确认表")
+public class BandingTaskClassStudentSure implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+     * 规则名称
+     */
+    @ApiModelProperty("分班表的id")
+    private Long bandingTaskClassId;
+    /**
+     * 专业方向id
+     */
+    @ApiModelProperty("新生id")
+    private Long newStudentId;
+
+    @ApiModelProperty("状态(0:未确认 1:已确认)")
+    private Integer status;
+
+}

+ 4 - 0
src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskClassMapper.java

@@ -25,12 +25,16 @@ public interface BandingTaskClassMapper extends MPJBaseMapper<BandingTaskClass>
 
     List<BandingTaskClassStudentListVo> getClassStudent(@Param("dto") BandingTaskClassStudentPageDto dto);
 
+    List<BandingTaskClassStudentListVo> getClassStudentSure(@Param("dto") BandingTaskClassStudentPageDto dto);
+
     List<IdCountVo> getMajorClassCount(@Param("id") Long bandingTaskId);
 
     List<IdCountVo> getMajorClassStudentCount(@Param("id") Long bandingTaskId);
 
     List<BandingTaskClassSureListVo> getClassSure(@Param("dto") BandingTaskClassStudentPageDto dto);
 
+    List<BandingTaskClassSureListVo> getClassNotSure(@Param("dto") BandingTaskClassStudentPageDto dto);
+
 
     List<BandingTaskClass> getListOrderByAsc(@Param("id") Long bandingTaskId);
 

+ 4 - 0
src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskClassStudentMapper.java

@@ -20,5 +20,9 @@ public interface BandingTaskClassStudentMapper extends MPJBaseMapper<BandingTask
 
     List<BaseNewStudentPageDto> satisfyStudent(@Param("dto") StudentDto dto);
 
+    List<BaseNewStudentPageDto> satisfyStudentSure(@Param("dto") StudentDto dto);
+
     List<BaseNewStudentPageDto> surplusStudent(@Param("dto") StudentDto dto);
+
+    List<BaseNewStudentPageDto> surplusStudentSure(@Param("dto") StudentDto dto);
 }

+ 22 - 0
src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskClassStudentSureMapper.java

@@ -0,0 +1,22 @@
+package com.xjrsoft.module.banding.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.banding.dto.StudentDto;
+import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
+import com.xjrsoft.module.banding.entity.BandingTaskClassStudentSure;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @title: 新生分班任务班级学生关系确认表
+ * @Author dzx
+ * @Date: 2025年5月28日
+ * @Version 1.0
+ */
+@Mapper
+public interface BandingTaskClassStudentSureMapper extends MPJBaseMapper<BandingTaskClassStudentSure> {
+
+}

+ 8 - 1
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -157,12 +157,19 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
         BandingTask bandingTask = bandingTaskMapper.selectById(dto.getBandingTaskId());
         dto.setGradeId(bandingTask.getGradeId());
         dto.setEnrollType(bandingTask.getEnrollType());
+        if(bandingTask.getStatus() != null && bandingTask.getStatus() == 1){
+            return this.baseMapper.getClassStudentSure(dto);
+        }
         return this.baseMapper.getClassStudent(dto);
     }
 
     @Override
     public List<BandingTaskClassSureListVo> getClassSure(BandingTaskClassStudentPageDto dto) {
-        return this.baseMapper.getClassSure(dto);
+        BandingTask task = bandingTaskMapper.selectById(dto.getBandingTaskId());
+        if(task.getStatus() != null && task.getStatus() == 1){
+            return this.baseMapper.getClassSure(dto);
+        }
+        return this.baseMapper.getClassNotSure(dto);
     }
 
     @Override

+ 16 - 4
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -18,10 +18,12 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
 import com.xjrsoft.module.banding.dto.StudentDto;
+import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
+import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
@@ -68,6 +70,8 @@ import java.util.stream.Collectors;
 @Service
 @AllArgsConstructor
 public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
+
+    private final BandingTaskMapper taskMapper;
     private final BandingTaskClassMapper taskClassMapper;
     private final IStudentReportPlanService reportPlanService;
     private final IBaseSemesterService semesterService;
@@ -75,12 +79,8 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
     private final StudentReportRecordMapper reportRecordMapper;
 
     private final IBaseClassService classService;
-    private final CommonPropertiesConfig propertiesConfig;
     private final IUserService userService;
     private final IUserRoleRelationService roleRelationService;
-    private final IBaseStudentSchoolRollService schoolRollService;
-    private final IBaseStudentService studentService;
-    private final IBaseStudentFamilyService familyService;
     private final RedisUtil redisUtil;
 
     @Override
@@ -344,6 +344,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
     public List<BaseNewStudentPageDto> satisfyStudent(StudentDto dto) {
         BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
         dto.setBandingTaskId(taskClass.getBandingTaskId());
+
+        BandingTask task = taskMapper.selectById(taskClass.getBandingTaskId());
+        if(task.getStatus() != null && task.getStatus() == 1){
+            return this.baseMapper.satisfyStudentSure(dto);
+        }
+
         return this.baseMapper.satisfyStudent(dto);
     }
 
@@ -352,6 +358,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
         BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
         dto.setMajorSetId(taskClass.getMajorSetId());
         dto.setBandingTaskId(taskClass.getBandingTaskId());
+
+        BandingTask task = taskMapper.selectById(taskClass.getBandingTaskId());
+        if(task.getStatus() != null && task.getStatus() == 1){
+            return this.baseMapper.satisfyStudentSure(dto);
+        }
+
         return this.baseMapper.surplusStudent(dto);
     }
 

+ 26 - 0
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.banding.service.impl;
 
 import cn.dev33.satoken.secure.BCrypt;
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -26,10 +27,12 @@ import com.xjrsoft.module.banding.entity.BandingRule;
 import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
+import com.xjrsoft.module.banding.entity.BandingTaskClassStudentSure;
 import com.xjrsoft.module.banding.entity.BandingTaskMajorCondition;
 import com.xjrsoft.module.banding.entity.BandingTaskRule;
 import com.xjrsoft.module.banding.mapper.BandingRuleMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
+import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentSureMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskRuleMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
@@ -98,6 +101,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
     private final BandingRuleMapper ruleMapper;
     private final BandingTaskRuleMapper taskRuleMapper;
     private final BandingTaskClassMapper taskClassMapper;
+    private final BandingTaskClassStudentSureMapper taskClassStudentSureMapper;
     private final IBaseNewStudentService newStudentService;
     private final IBandingTaskClassStudentService classStudentService;
     private final IBandingTaskMajorConditionService conditionService;
@@ -855,6 +859,8 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 reportRecordMapper.insert(record);
             }
         }
+        //确认分班时,将已经分班的数据固化下来,后续查询也需要进行调整
+        lockData(bandingTask);
 
         bandingTask.setStatus(1);
         bandingTask.setModifyDate(new Date());
@@ -885,4 +891,24 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
     void updateBaseNewStudentStatus(Long bandingTaskId, Integer operateMode, Long baseNewStudentId){
 
     };
+
+    /**
+     * 确认后,将分班数的数据情况固化
+     */
+    void lockData(BandingTask task){
+        List<BandingTaskClassStudent> studentList = classStudentService.list(
+                new MPJLambdaWrapper<BandingTaskClassStudent>()
+                        .select(BandingTaskClassStudent::getId)
+                        .select(BandingTaskClassStudent.class, x -> VoToColumnUtil.fieldsToColumns(BandingTaskClassStudent.class).contains(x.getProperty()))
+                        .innerJoin(BandingTaskClass.class, BandingTaskClass::getId, BandingTaskClassStudent::getBandingTaskClassId)
+                        .eq(BandingTaskClassStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(BandingTaskClass::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(BandingTaskClass::getBandingTaskId, task.getId())
+        );
+
+        for (BandingTaskClassStudent bandingTaskClassStudent : studentList) {
+            BandingTaskClassStudentSure studentSure = BeanUtil.toBean(bandingTaskClassStudent, BandingTaskClassStudentSure.class);
+            taskClassStudentSureMapper.insert(studentSure);
+        }
+    }
 }

+ 1 - 1
src/main/resources/application.yml

@@ -5,7 +5,7 @@ server:
 spring:
   # 环 io境 dev|pre|prod
   profiles:
-    active: dev
+    active: pre
   # jackson时间格式化
   jackson:
     time-zone: GMT+8

+ 108 - 0
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -51,6 +51,42 @@
     </select>
 
     <select id="getClassSure" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo">
+        SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name,t1.sort_code,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1) AS NUMBER,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.gender = 'SB10001') AS male_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.gender = 'SB10002') AS female_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3001') AS not_stay_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3002') AS stay_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3001' AND a1.gender = 'SB10001') AS male_not_stay_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3002' AND a1.gender = 'SB10001') AS male_stay_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3001' AND a1.gender = 'SB10002') AS female_not_stay_count,
+        (SELECT COUNT(*) FROM base_new_student a1
+        INNER JOIN banding_task_class_student_sure a2 ON a1.id = a2.new_student_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.is_can_banding = 1 AND a1.stduy_status = 'FB3002' AND a1.gender = 'SB10002') AS female_stay_count,
+        t3.name AS teacher_name,t4.name AS classroom_name, t1.is_order_class FROM banding_task_class t1
+        LEFT JOIN base_major_set t2 ON t1.major_set_id = t2.id
+        LEFT JOIN xjr_user t3 ON t1.teacher_id = t3.id
+        LEFT JOIN base_classroom t4 ON t1.classroom_id = t4.id
+        WHERE t1.delete_mark = 0 AND t1.banding_task_id = #{dto.bandingTaskId}
+    </select>
+
+    <select id="getClassNotSure" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo">
         SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name,t1.sort_code,
         (SELECT COUNT(*) FROM base_new_student a1
         INNER JOIN banding_task_class_student a2 ON a1.id = a2.new_student_id
@@ -157,7 +193,79 @@
                 </if>
             </if>
         </if>
+    </select>
 
+    <select id="getClassStudentSure" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo">
+        SELECT t1.id,t1.credential_number,t1.name,t4.name AS gender_cn,t1.graduate_school,t1.graduate_class,t1.remarks,
+        t5.name AS first_ambition, t6.name AS second_ambition,t7.name AS stduy_status_cn,t1.height,t1.weight,t1.score,t3.name AS class_name,
+        t8.name AS teacher_name FROM base_new_student t1
+        LEFT JOIN banding_task_class_student_sure t2 ON t1.id = t2.new_student_id AND t2.delete_mark = 0
+        LEFT JOIN banding_task_class t3 ON t2.banding_task_class_id = t3.id
+        AND t3.delete_mark = 0 AND t3.banding_task_id = #{dto.bandingTaskId}
+        LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code
+        LEFT JOIN base_major_set t5 ON t1.first_ambition = t5.id
+        LEFT JOIN base_major_set t6 ON t1.second_ambition = t6.id
+        LEFT JOIN xjr_dictionary_detail t7 ON t1.stduy_status = t7.code
+        LEFT JOIN xjr_user t8 ON t3.teacher_id = t8.id
+        INNER JOIN enrollment_plan t9 ON t1.enrollment_plan_id = t9.id
+        WHERE t1.delete_mark = 0 and t1.is_can_banding = 1
+        and t9.grade_id = #{dto.gradeId} and t9.enroll_type = #{dto.enrollType}
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            AND t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.name != null and dto.name != ''">
+            AND t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
+            AND t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
+        </if>
+        <if test="dto.graduateClass != null and dto.graduateClass != ''">
+            AND t1.graduate_class like concat('%', #{dto.graduateClass}, '%')
+        </if>
+        <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
+            AND t1.stduy_status = #{dto.stduyStatus}
+        </if>
+        <if test="dto.secondAmbition != null">
+            AND t1.second_ambition = #{dto.secondAmbition}
+        </if>
+        <if test="dto.firstAmbition != null">
+            AND t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.status != null">
+            <if test="dto.status == 1">
+                AND t3.name is not null
+            </if>
+            <if test="dto.status == 0">
+                AND t3.name is null
+            </if>
+        </if>
+        <if test="dto.className != null and dto.className != ''">
+            AND t3.name like concat('%', #{dto.className}, '%')
+        </if>
+        <if test="dto.order != null">
+            <if test="dto.order == 'ascend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
+            </if>
+        </if>
     </select>
 
     <select id="getMajorClassCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">

+ 101 - 0
src/main/resources/mapper/banding/BandingTaskClassStudentMapper.xml

@@ -51,6 +51,54 @@
         </if>
     </select>
 
+    <select id="satisfyStudentSure" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+        SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
+        t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
+        t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
+        INNER JOIN banding_task_class_student_sure t5 ON t1.id = t5.new_student_id
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
+        LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
+        LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
+        LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
+        WHERE t1.delete_mark = 0 AND t5.delete_mark = 0 and t1.is_can_banding = 1
+        AND t5.banding_task_class_id = #{dto.bandingTaskClassId}
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name},'%')
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
+        </if>
+        <if test="dto.order != null">
+            <if test="dto.order == 'ascend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
+            </if>
+        </if>
+    </select>
+
     <select id="surplusStudent" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
         SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
         t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
@@ -103,4 +151,57 @@
             </if>
         </if>
     </select>
+
+    <select id="surplusStudentSure" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+        SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
+        t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
+        t8.name as second_ambition,t1.is_adjust,t1.status,t1.remarks FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
+        LEFT JOIN banding_task t5 ON t4.grade_id = t5.grade_id AND t4.enroll_type = t5.enroll_type
+        LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
+        LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
+        LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
+        WHERE t1.delete_mark = 0 AND t5.id = #{dto.bandingTaskId}
+        and t1.is_can_banding = 1
+        AND (t1.first_ambition_id = #{dto.majorSetId} or t1.second_ambition_id = #{dto.majorSetId})
+        and t1.id not in (SELECT new_student_id FROM banding_task_class_student_sure c1
+        INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
+        WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{dto.bandingTaskId}
+        )
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name},'%')
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
+        </if>
+        <if test="dto.order != null">
+            <if test="dto.order == 'ascend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
+            </if>
+        </if>
+    </select>
 </mapper>

+ 61 - 0
src/main/resources/sqlScript/20250526_sql.sql

@@ -0,0 +1,61 @@
+ALTER TABLE attendance_rule_category
+  ADD COLUMN is_default_show INT (0) NULL COMMENT '是否默认显示(1:是 0:否)' AFTER user_relation;
+  
+  
+ALTER TABLE attendance_user_relation
+  ADD INDEX (user_id);
+  
+ALTER TABLE wf_student_resume_schooling
+  ADD COLUMN student_name VARCHAR (20) NULL COMMENT '学生名称' AFTER remarks;
+
+
+
+
+CREATE TABLE wechat_message_send_log
+(
+    id                BIGINT        NOT NULL COMMENT '主键编号' PRIMARY KEY,
+    create_date       DATETIME      NULL COMMENT '创建时间',
+    modify_date       DATETIME      NULL COMMENT '修改时间',
+    delete_mark       INT           NOT NULL COMMENT '删除标记',
+    enabled_mark      INT           NOT NULL COMMENT '有效标志',
+    open_id           VARCHAR(30)   NOT NULL COMMENT '用户的open_id',
+    params            VARCHAR(500)  NOT NULL COMMENT '发送参数',
+    result            VARCHAR(500)  NOT NULL COMMENT '接口调用返回参数',
+    template_id       VARCHAR(50)   NOT NULL  COMMENT '微信消息模板id'
+) COMMENT '微信消息发送记录';
+
+
+CREATE TABLE `attendance_message_log` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `template_id` VARCHAR(100) DEFAULT NULL COMMENT '发送模板id',
+  `send_time` DATETIME DEFAULT NULL COMMENT '发送时间',
+  `content` TEXT COMMENT '发送内容',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='考勤消息发送记录';
+
+-- -------------------------------------------------------------------------------------------------------
+-- 新生分班任务班级学生关系确认表
+-- -------------------------------------------------------------------------------------------------------
+CREATE TABLE `banding_task_class_student_sure` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `banding_task_class_id` BIGINT DEFAULT NULL COMMENT '分班表的id',
+  `new_student_id` BIGINT DEFAULT NULL COMMENT '新生id',
+  `status` INT DEFAULT '0' COMMENT '状态(0:未确认 1:已确认)',
+  `is_report` INT DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE,
+  KEY `banding_task_class_id` (`banding_task_class_id`),
+  KEY `new_student_id` (`new_student_id`),
+  KEY `delete_mark` (`delete_mark`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='新生分班任务班级学生关系确认表';