package com.jeeplus.test.workContract.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.oss.domain.WorkAttachment;
import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo;
import com.jeeplus.test.workContract.domain.WorkContractInfo;
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WorkContractInfoMapper extends BaseMapper<WorkContractInfo> {

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

    WorkContractInfo findById (@Param("id") String id);

    Integer findIsExit(@Param("id") String id, @Param("name")String name);

    List<WorkAttachment> findList(@Param("id") String id);

    List<WorkAttachmentDto> findDtos(@Param("id") String id);

    List<WorkAttachmentDto> findByAttachmentIdAndFlag(@Param("attachmentId") String id,@Param("attachmentFlag") String attachmentFlag);

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

    IPage<ProgramProjectListInfo> relationProjectList(@Param("id") String id, Page<ProgramProjectListInfo> page);

    /**
     * 根据客户id查询合同信息
     * @param clientId
     * @return
     */
    List<WorkContractInfoDto> getInfoByClientId (@Param("clientId") String clientId);
}
