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

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.groupshift.vo.AttendanceGroupShiftPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshift.AttendanceGroupShiftDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 考勤组班次 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface AttendanceGroupShiftMapper extends BaseMapperX<AttendanceGroupShiftDO> {

    default PageResult<AttendanceGroupShiftDO> selectPage(AttendanceGroupShiftPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceGroupShiftDO>()
                .eqIfPresent(AttendanceGroupShiftDO::getAttendanceGroupId, reqVO.getAttendanceGroupId())
                .likeIfPresent(AttendanceGroupShiftDO::getName, reqVO.getName())
                .betweenIfPresent(AttendanceGroupShiftDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttendanceGroupShiftDO::getId));
    }

}