package com.jeeplus.finance.projectReport.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jeeplus.finance.projectReport.domain.CwProjectReportFile;
import com.jeeplus.finance.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
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;

/**
 * 新建行文件表
 * @author: 王强
 * @create: 2022-11-16 21:23
 **/
@Mapper
public interface ProjectReportWorkAttachmentMapper extends BaseMapper<CwProjectReportFile> {

    void updateFileInfo(ProjectReportWorkAttachmentDTO dto);

    List<String> getIdByAttachmentId(String id);

    List<String> getFileId(String id);

    void deleteByRepotyId(String id);

    void deleteByAttachMnentId(String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ProjectReportWorkAttachmentDTO> selectByInfoId(String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ProjectReportWorkAttachmentDTO> selectByInfoIdAndNewLineId(String id);

    @InterceptorIgnore(tenantLine = "true")
    CwProjectReportFile selectInfoByFileId(@Param("id") String id,@Param("fileType") String fileTType);

    /**
     * 查询电子章文件信息
     * @param id
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> selectWorkAttachmentByReportId(String id);

    /**
     * 根据id修改文件信息（cw签章文件替换）
     * @param workattachment
     * @return
     */
    Integer updateByIdOnSignature(WorkAttachmentInfo workattachment);

    /**
     * 签章保存附件信息
     * @param workAttachment
     * @param userDto
     */
    @InterceptorIgnore(tenantLine = "true")
    void insertWorkAttachment (@Param("workAttachment") WorkAttachmentInfo workAttachment, @Param("userDto") UserDTO userDto);
}
