package org.qinan.safetyeval.domain.gateway;

import org.qinan.safetyeval.domain.entity.QualFilingPersonnelEntity;
import org.qinan.safetyeval.domain.query.QualFilingPersonnelQuery;
import org.qinan.safetyeval.domain.query.PageResult;

import java.time.LocalDate;
import java.util.List;

/**
 * 备案申请人员Gateway接口（Domain层定义）
 *
 * @author safety-eval
 */
public interface QualFilingPersonnelGateway {

    QualFilingPersonnelEntity save(QualFilingPersonnelEntity entity);

    QualFilingPersonnelEntity get(Long id);

    List<QualFilingPersonnelEntity> listByFilingId(Long filingId);

    QualFilingPersonnelEntity modify(QualFilingPersonnelEntity entity);

    void delete(Long id);

    PageResult<QualFilingPersonnelEntity> page(QualFilingPersonnelQuery query);

    /**
     * 统计指定备案下的人员总数
     */
    int countByFilingId(Long filingId);

    /**
     * 统计指定备案下注册工程师数量
     */
    int countByFilingIdAndRegisterEngineerFlag(Long filingId, Integer registerEngineerFlag);

    /**
     * 统计指定备案下参加工作时间晚于指定日期的人数
     */
    int countByFilingIdAndJoinWorkDateAfter(Long filingId, LocalDate joinWorkDate);
}
