Files
hzdyjs/docs/变更管理/code-adjust-record-2025-07-13-wuzhen.md
T
2025-07-24 21:03:00 +08:00

2.4 KiB

招生就业模块代码调整记录

修复招生报名信息学院字段显示问题

时间: 2025-07-13 09:30:15

问题描述

在"招生就业》报名信息》查看招生报名信息"页面中,所属学院和学院代码字段没有正确显示后台数据。

原因分析

  1. 后端VO类缺少这两个字段:在ZsjyEnrollmentInfoVo.java中没有定义collegeName和collegeId字段
  2. Mapper SQL查询中没有包含这两个字段:selectZsjyEnrollmentInfoVo查询没有包含college_name和college_id
  3. ResultMap映射中缺少这两个字段:ZsjyEnrollmentInfoResult映射中没有映射这两个字段
  4. 字段拼写问题:代码中使用college_name和college_id,但数据库中可能是collage_name和collage_id

修复方案

  1. 在VO类中添加字段:

    • 在ZsjyEnrollmentInfoVo.java中添加collegeName和collegeId字段及其注解
  2. 更新Mapper XML:

    • 在selectZsjyEnrollmentInfoVo查询中添加college_name和college_id字段
    • 在ZsjyEnrollmentInfoResult映射中添加这两个字段的映射
    • 在查询条件中添加对这两个字段的处理

修改内容

  1. 在ZsjyEnrollmentInfoVo.java中添加:

    /**
     * 学院名称
     */
    @ExcelProperty(value = "学院名称")
    private String collegeName;
    
    /**
     * 学院代码
     */
    @ExcelProperty(value = "学院代码")
    private String collegeId;
    
  2. 在ZsjyEnrollmentInfoMapper.xml中更新SQL查询:

    select ..., college_name, college_id, ... 
    from zsjy_enrollment_info
    
  3. 在ZsjyEnrollmentInfoMapper.xml中添加ResultMap映射:

    <result property="collegeName" column="college_name"/>
    <result property="collegeId" column="college_id"/>
    
  4. 添加查询条件:

    <if test="collegeName != null and collegeName != ''">and college_name like concat('%', #{collegeName}, '%')</if>
    <if test="collegeId != null and collegeId != ''">and college_id = #{collegeId}</if>
    

执行步骤

后端代码修改已完成,需要重新编译部署后端:

# 在backend目录执行
mvn clean package -DskipTests

验证方法

  1. 重新部署后端服务
  2. 登录系统,进入"招生就业》报名信息"模块
  3. 点击查看按钮,检查所属学院和学院代码字段是否正确显示

责任人

  • 开发: 吴振
  • 测试: 待定
  • 审核: 待定