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.CwProjectReportData;
import com.jeeplus.finance.projectReport.domain.CwProjectReportNumberApply;
import com.jeeplus.finance.projectReport.domain.CwProjectReview;
import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.ReportNoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author 王强
 * @version 1.0
 * @date 2023-12-12 16:59
 */
@Mapper
public interface CwProjectReportNumberApplyMapper extends BaseMapper<CwProjectReportNumberApply> {

    @InterceptorIgnore(tenantLine = "true")
    CwProjectReportNumberApply selectByReportId(String id);

    CwProjectReportData selectByPortId(String id);

    void updateReviewStatysByReportId(@Param("reviewStatus") String reviewStatus, @Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    void updateReviewById(CwProjectReportNumberApply review);

    /**
     * 根据报告号前缀查询最大的报告号（用于跨年领号）
     * @param reportNoPrefix 报告号前缀，例如：苏兴会基字[2023]
     * @return 最大的报告号信息
     */
    @InterceptorIgnore(tenantLine = "true")
    ReportNoDto getMaxReportNoByPrefix(@Param("reportNoPrefix") String reportNoPrefix);
}
