package cn.iocoder.yudao.module.system.dal.mysql.equipment;

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.equipment.vo.datasynchronousrecord.DataSynchronousRecordPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.equipment.DataSynchronousRecordDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 考勤机数据同步记录 Mapper
 *
 * @author 符溶馨
 */
@Mapper
public interface DataSynchronousRecordMapper extends BaseMapperX<DataSynchronousRecordDO> {

    default PageResult<DataSynchronousRecordDO> selectPage(DataSynchronousRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataSynchronousRecordDO>()
                .eqIfPresent(DataSynchronousRecordDO::getDeviceNo, reqVO.getDeviceNo())
                .eqIfPresent(DataSynchronousRecordDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DataSynchronousRecordDO::getResult, reqVO.getResult())
                .betweenIfPresent(DataSynchronousRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataSynchronousRecordDO::getId));
    }

}