package org.qinan.safetyeval.infrastructure.persistence.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.repo.BaseRepository;
import org.qinan.safetyeval.client.change.request.QualFilingMaterialChangePageQry;
import org.qinan.safetyeval.infrastructure.persistence.domainobject.QualFilingMaterialChangeDO;

import java.util.List;

/**
 * 备案申请材料-变更
 *
 * @Author: ltq
 * @date 2026-07-02 10:04:07
 */
public interface QualFilingMaterialChangeRepository extends BaseRepository<QualFilingMaterialChangeDO> {
    /**
     * 根据ID查找
     *
     * @param id 备案申请材料-变更ID
     * @return
     */
    QualFilingMaterialChangeDO getById(Long id);

    /**
     * 分页查找备案申请材料-变更对象
     *
     * @param iPage                           分页对象
     * @param qualFilingMaterialChangePageQry 条件对象
     * @return ipage
     */
    IPage<QualFilingMaterialChangeDO> listQualFilingMaterialChangePage(IPage iPage, QualFilingMaterialChangePageQry qualFilingMaterialChangePageQry);

    /**
     * 新增备案申请材料-变更
     *
     * @param qualFilingMaterialChangeDO 备案申请材料-变更
     * @return 结果
     */
    Boolean addQualFilingMaterialChange(QualFilingMaterialChangeDO qualFilingMaterialChangeDO);

    /**
     * 修改备案申请材料-变更
     *
     * @param qualFilingMaterialChangeDO 备案申请材料-变更
     * @return 结果
     */
    Boolean updateQualFilingMaterialChange(QualFilingMaterialChangeDO qualFilingMaterialChangeDO);


    /**
     * 删除备案申请材料-变更
     *
     * @param id
     * @return 结果
     */
    Boolean deletedQualFilingMaterialChangeById(Long id);

    /**
     * 删除备案申请材料-变更
     *
     * @param ids
     * @return 结果
     */
    Boolean deletedQualFilingMaterialChangeByIds(Long[] ids);

    /**
     * 根据filingId查询备案申请材料-变更列表
     */
    List<QualFilingMaterialChangeDO> listByFilingId(Long filingId);

    /**
     * 统计指定filingId下满足上传状态和材料类型的记录数
     */
    int countByFilingIdAndUploadStatusCodeAndMaterialType(Long filingId, Integer uploadStatusCode, String materialType);

}
