package com.jeeplus.human.practice.register.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.practice.register.domain.Registration;
import com.jeeplus.human.practice.register.service.dto.RegistrationDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 实习人员登记表 mapper
 * @author 王强
 * @version 1.0
 * @date 2023-09-13 14:01
 */
@Mapper
@InterceptorIgnore(tenantLine = "true")
public interface InterRegistrationMapper extends BaseMapper<Registration> {
    @InterceptorIgnore(tenantLine = "true")
    void updateStatusById(@Param("id") String id, @Param("type") String type);
    /**
     * 查询实习人员登记表
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<RegistrationDto> findList(Page<RegistrationDto> page, @Param(Constants.WRAPPER) QueryWrapper<RegistrationDto> queryWrapper);

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

    @InterceptorIgnore(tenantLine = "true")
    Registration getById(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    void removeById(String id);

    void updatePracticeStatus(@Param("createById")String createById,@Param("endTime")String endTime);

    List<Registration> getTimeOutRegisters(@Param("threeDayAgo")String threeDayAgo);

    //获取最后一次发起报销且实习状态为结束，并且报销状态为完成的
    List<Registration> getTimeOutReimburseRegisters();

    /**
     * 根据id物理删除这条实习信息 (包括实现登记信息，实现经验信息，家庭成员信息)
     * @param id
     */
    void deleteByIdOnPhysic(@Param("id")String id);
}
