package com.jeeplus.human.enrollment.enrollmentRegistration.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.human.enrollment.enrollmentRegistration.domain.EnrollmentRegistration;
import com.jeeplus.human.enrollment.enrollmentRegistration.service.dto.ExportDTO;
import com.jeeplus.human.practice.register.domain.Registration;
import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 王强
 * @version 1.0
 * @date 2023-09-27 14:26
 */
@Mapper
@InterceptorIgnore(tenantLine = "true")
public interface EnrollmentRegistrationMapper extends BaseMapper<EnrollmentRegistration> {

    /**
     * 查询入职人员登记表
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<EnrollmentRegistration> findList(Page<EnrollmentRegistration> page, @Param(Constants.WRAPPER) QueryWrapper<EnrollmentRegistration> queryWrapper);
    //导出
    IPage<ExportDTO> exportList(Page<ExportDTO> page, @Param(Constants.WRAPPER) QueryWrapper<ExportDTO> queryWrapper);

    @InterceptorIgnore(tenantLine = "true")
    EnrollmentRegistration getById(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    EnrollmentRegistration getInfoByUserId(@Param("userId") String userId);

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

    void removeById(@Param("id") String id);

    /**
     * 根据用户id修改状态
     */
    void updateByUserId(@Param("userId") String userId);

    void updateDdIdById(EnrollmentRegistration enrollmentRegistration);



    List<EnrollmentRegistration> getFormalUserInfo();

    /**
     * 查询出 实习与入职登记表中 有效的用户id
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<String> getAllUserIdInSuccess();

    /**
     * 根据id物理删除这条入职登记信息 (包括入职登记信息，社保卡信息)
     * @param id
     */
    void deleteByIdOnPhysic(@Param("id") String id);

    /**
     * 根据用户id查询数据
     * @param userId
     * @return
     */
    EnrollmentRegistration getByUserId(@Param("userId")String userId);

    /**
     * 根据用户id删除信息
     * @param id
     */
    void delByUserId(@Param("id")String id);
    /*8
    根据手机号查询信息
     */
    EnrollmentRegistration getByMobile(@Param("mobilePhone") String mobilePhone);

    List<WorkAttachmentInfoDTO> findDtos(@Param("id")String id,@Param("attachmentFlag")String attachmentFlag);


    List<WorkAttachmentInfoDTO> findDtosById(@Param("id")String id);



    void updateApprovalTime(@Param("userId")String userId);
}
