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

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AskLeavePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyAskLeaveDO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 老人请假外出管理 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ElderlyAskLeaveMapper extends BaseMapperX<ElderlyAskLeaveDO> {

    List<ElderlyAskLeaveDO> selectPageWithLocationFilter(Page<ElderlyAskLeaveDO> page,
                                                         @Param("reqVO") AskLeavePageReqVO reqVO);

    default PageResult<ElderlyAskLeaveDO> selectPage(AskLeavePageReqVO reqVO){
        Page<ElderlyAskLeaveDO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize());
        List<ElderlyAskLeaveDO> list = selectPageWithLocationFilter(page, reqVO);
        return new PageResult<>(list, page.getTotal());
    }

}