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.elderlyadapt.ElderlyAdaptServiceRecordPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyAdaptServiceRecordDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;

/**
 * 长者入住适应服务记录 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface ElderlyAdaptServiceRecordMapper extends BaseMapperX<ElderlyAdaptServiceRecordDO> {

    default PageResult<ElderlyAdaptServiceRecordDO> selectPage(ElderlyAdaptServiceRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlyAdaptServiceRecordDO>()
                .likeIfPresent(ElderlyAdaptServiceRecordDO::getElderName, reqVO.getElderName())
                .betweenIfPresent(ElderlyAdaptServiceRecordDO::getRecordTime, reqVO.getRecordTime())
                .eqIfPresent(ElderlyAdaptServiceRecordDO::getElderId, reqVO.getElderId())
                .eqIfPresent(ElderlyAdaptServiceRecordDO::getType, reqVO.getType())
                .eqIfPresent(ElderlyAdaptServiceRecordDO::getTenantId, reqVO.getTenantId())
                .orderByDesc(ElderlyAdaptServiceRecordDO::getId));
    }
}
