package com.yc.ship.module.resource.dal.mysql.guidecheckin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.resource.controller.admin.guidecheckin.vo.GuideCheckInPageReqVO;
import com.yc.ship.module.resource.dal.dataobject.guidecheckin.GuideCheckInDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 导游出勤 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface GuideCheckInMapper extends BaseMapperX<GuideCheckInDO> {

    default PageResult<GuideCheckInDO> selectPage(GuideCheckInPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GuideCheckInDO>()
                .eqIfPresent(GuideCheckInDO::getGuideId, reqVO.getGuideId())
                .betweenIfPresent(GuideCheckInDO::getCheckTime, reqVO.getCheckTime())
                .eqIfPresent(GuideCheckInDO::getStatus, reqVO.getStatus())
                .eqIfPresent(GuideCheckInDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(GuideCheckInDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(GuideCheckInDO::getId));
    }

    IPage<GuideCheckInDO> queryPage(IPage<GuideCheckInDO> iPage, @Param("param")
        GuideCheckInPageReqVO pageReqVO);

    List<Map> queryLeaveData(@Param("param") GuideCheckInPageReqVO pageReqVO);

}
