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

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

/**
 * 固定班制考勤设置 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface AttendanceFixedMapper extends BaseMapperX<AttendanceFixedDO> {

    default PageResult<AttendanceFixedDO> selectPage(AttendanceFixedPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceFixedDO>()
                .eqIfPresent(AttendanceFixedDO::getAttendanceGroupId, reqVO.getAttendanceGroupId())
                .betweenIfPresent(AttendanceFixedDO::getWeekTime, reqVO.getWeekTime())
                .eqIfPresent(AttendanceFixedDO::getAttendanceGroupShiftId, reqVO.getAttendanceGroupShiftId())
                .betweenIfPresent(AttendanceFixedDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttendanceFixedDO::getId));
    }

}