package com.jeeplus.pubmodules.holiday.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.pubmodules.holiday.domain.Holiday;
import com.jeeplus.pubmodules.holiday.service.dto.HolidayDTO;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper

public interface HolidayMapper extends BaseMapper<Holiday> {

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

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

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

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

    @InterceptorIgnore(tenantLine = "true")
    HolidayDTO findById(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    HolidayDTO findByUserId(@Param("id") String id);

    List<HolidayDTO> selectByUserId(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    void updateStatusById(@Param("status")String status, @Param("id")String id);

    @InterceptorIgnore(tenantLine = "true")
    void updateByIdForApp(@Param("holiday")Holiday holiday);
}
