package com.jeeplus.test.cw.reportCancellApplyArchived.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.sys.service.dto.UserDTO;
import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
import com.jeeplus.test.cw.projectReportArchive.service.dto.WorkAttachmentArchiveDto;
import com.jeeplus.test.cw.reportCancellApply.domain.ReportCancellApply;
import com.jeeplus.test.cw.reportCancellApply.service.dto.ReportInfoDto;
import com.jeeplus.test.cw.reportCancellApplyArchived.domain.CwProjectReportApplyArchive;
import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.CwWorkAttachmentArchiveDto;
import com.jeeplus.test.oss.domain.WorkAttachment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报告文号报废mapper
 * @author: 王强
 * @create: 2022-11-18 17:35
 **/
@Mapper
public interface ReportCancellApplyArchivedMapper extends BaseMapper<CwProjectReportApplyArchive> {

    /**
     * 查询报告数据集合
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<ArchivedReportInfoDto> getList(Page<ArchivedReportInfoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ArchivedReportInfoDto> queryWrapper, @Param("officeIds") String officeIds);

    ApplyArchiveReportDTO queryById(@Param("id") String id);

    CwProjectReportApplyArchive selectByApplyId(String id);

    /**
     * 根据attachmentId删除上传文件信息
     */
    void deleteFileInfo(String attachmentId);

    List<WorkAttachment> findList(@Param("id") String id);

    Integer findIsExit(@Param("id") String id, @Param("name")String name);

    void updateArchiveStyle(@Param("id") String id, @Param("status")String status);

    List<CwWorkAttachmentArchiveDto> selectFileInfoByAttid(String id);

    CwProjectReportApplyArchive selectByArchiveId(String id);

    /**
     * 查询项目信息
     * @return
     */
    CwProjectRecordsDTO selectProjectInfo(String id);

    UserDTO getUserInfo(String userId);

    void updateCancellArchiveType(@Param("status")String status,@Param("id")String id);

    /**
     * 根据合同id查询纸质归档信息
     * @param id
     * @return
     */
    ApplyArchiveReportDTO selectFilePaperByContractInfoId(String id);

    ApplyArchiveReportDTO queryByArchivedId(String id);

    void updateStatusByArchiveId(@Param("status")String status, @Param("id")String archiveId);

    /**
     * 获取新增行id
     * @param id
     * @return
     */
    String getNewLineId(String id);

    String getBfId(String newLineId);

    CwProjectReportApplyArchive getInfoByBFID(String bfId);

    CwProjectRecordsDTO getProjectByNewLineId(String reportNewLineId);
}
