package com.jeeplus.test.cw.projectReport.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.test.cw.projectRecords.domain.CwProjectRecords;
import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 财务-报告管理
 * @author: 王强
 * @create: 2022-11-16 14:17
 **/
@Mapper
public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {

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

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

    /**
     * 查询被服务单位
     * @param page
     * @param queryWrapper
     * @return
     */
    public IPage<CwWorkClientBaseDTO> findClineList(Page<CwWorkClientBaseDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwWorkClientBase> queryWrapper);

    String getUserNameById(String id);

    /**
     * 更改报告号签章id信息
     * @param cwProjectReportData
     */
    void updateSignatureInfo(CwProjectReportData cwProjectReportData);

    /**
     * 更改报告号签章id信息
     * @param cwProjectReportData
     */
    void updateSignatureUrl(CwProjectReportData cwProjectReportData);

    /**
     * 根据id修改del_flag状态
     * @param id
     */
    void updateDelFlag(@Param("flag")int flag,@Param("id") String id);

    /**
     * 根据签章id查询报告信息
     * @param contractId
     * @return
     */
    CwProjectReportData queryByContractId(@Param("contractId") String contractId);

    /**
     * 修改盖章状态
     * @param cwProjectReportData
     */
    void updateReportSealType(CwProjectReportData cwProjectReportData);

    /**
     * 根据项目id查出所有的reportID
     * @param projectId
     * @return
     */
    List<CwProjectReportData> getByProjectId(String projectId);
}
