package com.jeeplus.business.project.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.business.project.domain.JyProject;
import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import com.jeeplus.sys.service.dto.UserDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface JyProjectMapper extends BaseMapper<JyProject> {

    IPage<JyProject> findPageList(Page<JyProject> page, @Param(Constants.WRAPPER) QueryWrapper<JyProject> wrapper);

    List<String> getHaveProjectIds(@Param("currentUser")UserDTO userDTO);

    IPage<JyWorkContractInfo> findContractPageList(Page<JyWorkContractInfo> page, @Param("dto") JyWorkContractInfoDto dto);

    Integer getProByContractId(@Param("contractId")String contractId);

    JyProject getById(String id);

    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> findFileList(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    Integer findIsExit(@Param("id") String id, @Param("name")String name);

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

    IPage<JyProject> getByCreate(@Param("id")String id, Page<JyProject> page, @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);

    JyProject getByName(@Param("s")String s);

    void updateReportIssuanceById(@Param("id") String s, @Param("projectIssuance") String status);

    IPage<JyProject> getByCreateOut(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);

    void updateReportsSubmit(@Param("id")String s, @Param("status")String status);
}
