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.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AskLeavePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyAskLeaveDO;
import org.apache.ibatis.annotations.Mapper;


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

    default PageResult<ElderlyAskLeaveDO> selectPage(AskLeavePageReqVO reqVO){
        return selectPage(reqVO,new LambdaQueryWrapperX<ElderlyAskLeaveDO>()
                .eqIfPresent(ElderlyAskLeaveDO::getOrgType,reqVO.getOrgType())
                .likeIfPresent(ElderlyAskLeaveDO::getElderName,reqVO.getElderName())
                .betweenIfPresent(ElderlyAskLeaveDO::getOutDate,reqVO.getQueryTime())
                .inIfPresent(ElderlyAskLeaveDO::getTenantId,reqVO.getTenantIds())
                .orderByDesc(ElderlyAskLeaveDO::getCreateDate));
    }

}