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

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.groupuser.AttendanceGroupUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.groupuser.vo.*;

/**
 * 考勤组人员 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface AttendanceGroupUserMapper extends BaseMapperX<AttendanceGroupUserDO> {

    default PageResult<AttendanceGroupUserDO> selectPage(AttendanceGroupUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceGroupUserDO>()
                .eqIfPresent(AttendanceGroupUserDO::getAttendanceGroupId, reqVO.getAttendanceGroupId())
                .eqIfPresent(AttendanceGroupUserDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(AttendanceGroupUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttendanceGroupUserDO::getId));
    }

}