package com.ruoyi.system.mapper; import java.util.List; import java.util.Map; import com.ruoyi.system.domain.CjFillRecord; import org.apache.ibatis.annotations.Param; /** * 填报记录Mapper接口 * * @author ruoyi * @date 2026-09-09 */ public interface CjFillRecordMapper { /** * 按 任务+学生 查唯一记录 */ public CjFillRecord selectByTaskAndStudent(@Param("taskId") Long taskId, @Param("studentId") Long studentId); /** * 条件查询记录(taskId/studentId/status 等) */ public List selectCjFillRecordList(CjFillRecord record); public int insertCjFillRecord(CjFillRecord record); public int updateCjFillRecord(CjFillRecord record); public int deleteCjFillRecordByRecordId(Long recordId); /** * 按主键查询记录(详情查看用) */ public CjFillRecord selectByRecordId(Long recordId); /** * 退回草稿:清状态与提交时间(学生撤回 / 管理员退回共用) */ public int rollbackDraft(Long recordId); /** * 按班级统计应填人数(花名册,del_flag=0) * 返回行:{class_id, c} */ public List> classRosterCount(@Param("classIds") Long[] classIds); /** * 按任务+状态统计各班级记录数(取记录快照 class_id) * 返回行:{class_id, c} */ public List> classRecordCount(@Param("taskId") Long taskId, @Param("status") String status); /** * 任务范围内学生与填报状态(分页在 controller 用 startPage) * recordStatus: null/''=全部 'unfilled'=未填 '0'草稿 '1'已提交 * 返回行:{student_id,student_no,name,phone,class_id,class_name,record_id,record_status,submit_time} */ public List> rosterStates(@Param("taskId") Long taskId, @Param("classIds") Long[] classIds, @Param("recordStatus") String recordStatus, @Param("name") String name, @Param("classId") Long classId, @Param("majorId") Long majorId, @Param("collegeId") Long collegeId); /** * 导出用:范围内已有填报记录(含 form_data),按任务字段展开 * recordStatus: ''=全部记录(草稿+提交) '1'=已提交 '0'=草稿 */ public List> exportRecords(@Param("taskId") Long taskId, @Param("classIds") Long[] classIds, @Param("recordStatus") String recordStatus, @Param("name") String name, @Param("classId") Long classId, @Param("majorId") Long majorId, @Param("collegeId") Long collegeId); }