3.4 KiB
3.4 KiB
招聘管理简历管理功能修复记录
日期: 2025-07-30 14:30:00
开发人员: weizzzz
变更类型: 缺陷修复
变更内容摘要
修复了招聘管理模块中简历管理功能数据显示不全的问题。通过更新RsApplicationMapper.xml文件,确保后端能够正确查询和返回所有必要的字段数据,使前端能够完整显示应聘者信息。
详细变更内容
1. 更新RsApplicationMapper.xml文件
在backend/ruoyi-modules/ruoyi-rs/src/main/resources/mapper/rs/RsApplicationMapper.xml文件中:
-
在
resultMap中添加了缺失的字段映射:<result property="resumePath" column="resume_path"/> <result property="selfDescription" column="self_description"/> <result property="jobTitle" column="job_title"/> <result property="applicantName" column="applicant_name"/> <result property="contactPhone" column="contact_phone"/> <result property="contactEmail" column="contact_email"/> <result property="education" column="education"/> <result property="experience" column="experience"/> -
更新了查询SQL语句,包含所有必要字段:
<sql id="selectRsApplicationVo"> select a.application_id, a.job_id, a.applicant_id, a.apply_time, a.status, a.resume_path, a.self_description, a.job_title, a.applicant_name, a.contact_phone, a.contact_email, a.education, a.experience, a.hr_notes, a.create_by, a.create_time, a.update_by, a.update_time from rs_application a </sql> -
在查询条件中添加了对新增字段的支持:
<if test="jobTitle != null and jobTitle != ''">and a.job_title like concat('%', #{jobTitle}, '%')</if> <if test="applicantName != null and applicantName != ''">and a.applicant_name like concat('%', #{applicantName}, '%')</if> <if test="contactPhone != null and contactPhone != ''">and a.contact_phone like concat('%', #{contactPhone}, '%')</if> <if test="contactEmail != null and contactEmail != ''">and a.contact_email like concat('%', #{contactEmail}, '%')</if> -
在插入和更新语句中添加了对新增字段的支持:
- 插入语句中添加了新字段的判断和插入
- 更新语句中添加了新字段的判断和更新
解决的问题
- 修复了简历管理列表中大部分字段显示为空的问题
- 确保了前端能够正确显示职位名称、应聘者姓名、联系电话、联系邮箱等关键信息
- 使查询功能能够正确过滤这些字段的数据
- 保证了新增和修改操作能够正确处理这些字段的数据
问题原因分析
问题的根本原因是MyBatis映射文件中没有包含这些字段的映射配置,导致查询时无法从数据库获取这些字段的值。虽然实体类中定义了这些字段,但由于映射文件中没有相应的配置,所以查询结果中这些字段的值为null。
后续建议
- 在开发新功能时,确保MyBatis映射文件中包含实体类中定义的所有字段
- 对于已有功能,定期检查实体类和映射文件的一致性
- 考虑使用自动生成工具,确保实体类和映射文件的同步
- 添加单元测试,验证查询结果中包含所有必要的字段
重启说明
修改完成后,需要重启后端服务以使更改生效。前端无需重启,但需要刷新页面以获取最新数据。