package cn.iocoder.yudao.module.attendance.dal.mysql.schedulingmanage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.attendance.dal.dataobject.out.AttendanceOutDO;
import cn.iocoder.yudao.module.attendance.dal.dataobject.schedulingmanage.AttendanceSchedulingManageDO;
import cn.iocoder.yudao.module.system.enums.common.DeletedEnum;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.attendance.controller.admin.schedulingmanage.vo.*;

/**
 * 考勤排班管理 Mapper
 *
 * @author zhaopq
 */
@Mapper
public interface AttendanceSchedulingManageMapper extends BaseMapperX<AttendanceSchedulingManageDO> {

    default PageResult<AttendanceSchedulingManageDO> selectPage(AttendanceSchedulingManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceSchedulingManageDO>()
                .likeIfPresent(AttendanceSchedulingManageDO::getShiftName, reqVO.getShiftName())
                .betweenIfPresent(AttendanceSchedulingManageDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(AttendanceSchedulingManageDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(AttendanceSchedulingManageDO::getRemarks, reqVO.getRemarks())
                .eqIfPresent(AttendanceSchedulingManageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AttendanceSchedulingManageDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(AttendanceSchedulingManageDO::getTenantId, reqVO.getTenantId())
                .eq(AttendanceSchedulingManageDO::getDeleted, DeletedEnum.FALSE)
                .orderByDesc(AttendanceSchedulingManageDO::getId));
    }

}