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

import java.util.Date;
import java.util.List;

@Mapper
public interface JyWorkContractInfoMapper extends BaseMapper<JyWorkContractInfo> {

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

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

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

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

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

    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfoDTO> findByAttachmentIdAndFlag(@Param("attachmentId") String id,@Param("attachmentFlag") String attachmentFlag);

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



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


    void updateContractById(@Param("updateById")String updateById, @Param("updateTime")Date updateTime,@Param("filedType") String filedType,@Param("filedNo") String filedNo,@Param("id") String id);

    /**
     * 查询合同类型
     * @param contractType
     * @return
     */
    String findType(String contractType);

    String findType2(String s);
}
