package com.jeeplus.finance.reportCancellApplyArchived.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
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.finance.projectRecords.service.dto.CwProjectRecordsDTO;
import com.jeeplus.finance.reportCancellApplyArchived.domain.CwProjectReportApplyArchive;
import com.jeeplus.finance.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
import com.jeeplus.finance.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
import com.jeeplus.finance.reportCancellApplyArchived.service.dto.CwWorkAttachmentArchiveDto;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import com.jeeplus.sys.service.dto.UserDTO;
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
//@InterceptorIgnore(tenantLine = "true")
public interface ReportCancellApplyArchivedMapper extends BaseMapper<CwProjectReportApplyArchive> {

    /**
     * 查询报告数据集合
     * @param page
     * @param queryWrapper
     * @return
     */
    //@InterceptorIgnore(tenantLine = "true")
    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删除上传文件信息
     */
    @InterceptorIgnore(tenantLine = "true")
    void deleteFileInfo(String attachmentId);
    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> findList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    Integer findIsExit(@Param("id") String id, @Param("name")String name);

    @InterceptorIgnore(tenantLine = "true")
    void updateArchiveStyle(@Param("id") String id, @Param("status")String status);

    @InterceptorIgnore(tenantLine = "true")
    List<CwWorkAttachmentArchiveDto> selectFileInfoByAttid(String id);

    CwProjectReportApplyArchive selectByArchiveId(String id);

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

    @InterceptorIgnore(tenantLine = "true")
    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);

    @InterceptorIgnore(tenantLine = "true")
    CwProjectReportApplyArchive getInfoByBFID(String bfId);

    @InterceptorIgnore(tenantLine = "true")
    CwProjectRecordsDTO getProjectByNewLineId(String reportNewLineId);

    @InterceptorIgnore(tenantLine = "true")
    void updateInfoById(CwProjectReportApplyArchive cwProjectReportArchive);

    @InterceptorIgnore(tenantLine = "true")
    CwProjectReportApplyArchive getById(String id);
}
