liu
2026-09-22 0837c3ff473499d8a267924125c776b34cc8b517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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<CjFillRecord> 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<Map<String, Object>> classRosterCount(@Param("classIds") Long[] classIds);
 
    /**
     * 按任务+状态统计各班级记录数(取记录快照 class_id)
     * 返回行:{class_id, c}
     */
    public List<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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);
}