package cn.iocoder.yudao.module.system.dal.mysql.attendance.groupshiftitem;

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.system.controller.admin.groupshiftitem.vo.AttendanceGroupShiftItemPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshiftitem.AttendanceGroupShiftItemDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 考勤组班次子表 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface AttendanceGroupShiftItemMapper extends BaseMapperX<AttendanceGroupShiftItemDO> {

    default PageResult<AttendanceGroupShiftItemDO> selectPage(AttendanceGroupShiftItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceGroupShiftItemDO>()
                .eqIfPresent(AttendanceGroupShiftItemDO::getAttendanceGroupId, reqVO.getAttendanceGroupId())
                .eqIfPresent(AttendanceGroupShiftItemDO::getKqAttendanceGroupShiftId, reqVO.getKqAttendanceGroupShiftId())
                .eqIfPresent(AttendanceGroupShiftItemDO::getLevel, reqVO.getLevel())
                .betweenIfPresent(AttendanceGroupShiftItemDO::getBeginTime, reqVO.getBeginTime())
                .betweenIfPresent(AttendanceGroupShiftItemDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(AttendanceGroupShiftItemDO::getMustFlag, reqVO.getMustFlag())
                .eqIfPresent(AttendanceGroupShiftItemDO::getBeforePunchTimeUpWork, reqVO.getBeforePunchTimeUpWork())
                .eqIfPresent(AttendanceGroupShiftItemDO::getAfterPunchTimeUpWork, reqVO.getAfterPunchTimeUpWork())
                .eqIfPresent(AttendanceGroupShiftItemDO::getBeforePunchTimeDownWork, reqVO.getBeforePunchTimeDownWork())
                .eqIfPresent(AttendanceGroupShiftItemDO::getAfterPunchTimeDownWork, reqVO.getAfterPunchTimeDownWork())
                .betweenIfPresent(AttendanceGroupShiftItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttendanceGroupShiftItemDO::getId));
    }

}