package com.testor.module.train.examinationManage.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.testor.module.train.examinationManage.model.domain.TTrainExaminationManage;
import com.testor.module.train.examinationManage.model.dto.TTrainExaminationManageParam;
import com.tongtech.tfw.backend.common.models.supers.SuperDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 考试管理—安全培训教育Mapper接口
 *
 * @author testor-framework
 * @date 2022-09-07 11:43:25
 */
public interface TTrainExaminationManageDao extends SuperDao<TTrainExaminationManage> {
    IPage<TTrainExaminationManageParam> getExamAffiliation(Page<TTrainExaminationManageParam> resultPage, @Param("param") TTrainExaminationManageParam param, @Param("parentIds") String parentIds,@Param("orgId") String orgId);

    List<TTrainExaminationManageParam> getExamProjectPerson(@Param("id") String id);

    /**
     * 查询是否有补考数据
     * @return
     */
    @Select("select * from t_train_examination_manage\n" +
            "where status = '0' and is_repair = '1' and parent_id = #{id}")
    List<TTrainExaminationManageParam> getRepairExaminationManage(@Param("id") String id);
}
